-
Notifications
You must be signed in to change notification settings - Fork 6
/
example.ecmp
123 lines (77 loc) · 3.22 KB
/
example.ecmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# basic information about the package
[info]
name = example
version = 1.0.0
# If your are trying to make a package for a binary change this from "src" to "bin" an place it in the /bin dir
type = src
# If you intend to make a bundle, that is:
# A package that has no file of it's own, and only used to group dependencies and execute scripts
# use the "con" type
license = Example
# Here you put the url to the project
url = example.com
# The environment variable is like an additional config file that gets parsed along side the default one
# Useful if you are working on a complex project, and want to have a common set of variables
environment = example_environment
# Package exports
[exports]
// These is how you create an environment
// This file will be written to the default config dir as the name of the package
MY_EXAMPLE_PREFIX=/usr/example/
// Notice the different style of comments, in order to not conflict with the comments of the package, and still be visible when the file is written
// In order to access $MY_EXAMPLE_PREFIX in other packages, you would have to put ```environment = example``` in them.
# package description
[description]
Example package
# Here you type any dependencies this program needes
[dependencies]
example-dependency-1
# Here you type any optional dependencies this program might need
[optional]
example-dependency-2
# Use this to ask the user something
[inputs]
# be aware that the input might be Y or N since those
# can be passed by default form cccp so you should
# have sensible defaults in case that happens
this is a question, users input will be stored in $INPUT_n
this is a second question, users input will be stored in $INPUT_1
this is a third question, users input will be stored in $INPUT_2
# These are the files that need to be downloaded
[files]
# They are downloaded in the following format: name url sha256
IMG_9524.png https://example.com/IMG_9524.png d181ac6256...(sha256)
$NAME-$VERSION.tar.gz https://example.com/$NAME-$VERSION.tar.gz bc968e5286...(sha256)
# A Script to extract the archive
[download]
# The result should be a folder $NAME-$VERSION with the source
tar -xzf $NAME-$VERSION.tar.gz
# this is a bash script to build the package
[prepare]
# Usually just configuring and making the package is enough
# If something needs to be ran as root, it should be in the [install] section
./configure --prefix=/usr
make
# this is basically a bash script to install the package
[install]
# A package should be installed in the $BUILD_ROOT directory
# And make provided with $MAKE_FLAGS
# That is usually achived by having:
make DESTDIR=$BUILD_ROOT install
# Notice that there is no need to use sudo as
# packages are first installed to a temp dir
# and then moved to their location as root
# this is a bash script that is run after the installation
[special]
# If you want to run a command as root to do post-install work
# do it here
echo "This is SPECIAL"
# Also it should be noted that there are variables that are set before executing any of the scripts:
#
# $NAME
# $VERSION
# $TYPE
# $URL
# $LICENSE
#
# Which correspond to the package info in order to make updating easier.