Debian Codegraph @

build/pipelines/package.yaml

raw
1 ---
2
3 ##
4 # Aircrack-ng Pipeline Definition
5 #
6 # Built with the PyDeployer tool!
7 #
8 # https://github.com/jbenden/deployer
9 ##
10
11 - name: Packaging Preparations
12 tags:
13 - pkg
14 stage:
15 scope: false
16 tasks:
17 - name: Set package metadata
18 set:
19 artifacts: artifacts/aircrack-ng
20 www: '{% if env.ARTIFACT_WWW_ROOT %}{{ env.ARTIFACT_WWW_ROOT }}{% else %}/tmp/www{% endif %}'
21 description: |
22 Aircrack-ng is a complete suite of tools to assess WiFi network
23 security.
24
25 It focuses on different areas of WiFi security:
26
27 - Monitoring: Packet capture and export of data to text files
28 for further processing by third party tools.
29 - Attacking: Replay attacks, deauthentication, fake access points
30 and others via packet injection.
31 - Testing: Checking WiFi cards and driver capabilities (capture
32 and injection).
33 - Cracking: WEP and WPA PSK (WPA 1 and 2).
34
35 All tools are command line which allows for heavy scripting. A lot
36 of GUIs have taken advantage of this feature. It works primarily with
37 Linux but also Windows, OS X, FreeBSD, OpenBSD, NetBSD, as well as
38 Solaris and even the eComStation 2.
39 fpm: |
40 [ -e "{{ item.pkg }}" ] && rm -f "{{ item.pkg }}"
41 fpm -s dir \
42 -t "{{ item.pkg_type }}" \
43 -n "{{ item.pkg_name }}" \
44 -v "{{ item.pkg_version }}" \
45 --epoch 1 \
46 -C "{{ destdir }}" \
47 --license GPLv2 \
48 -m "[email protected]" \
49 --vendor 'The Aircrack-ng Project' \
50 --url 'https://aircrack-ng.org/' \
51 --description "{{ description }}" \
52 -p "{{ item.pkg_template }}" \
53 -x *.la \
54 {{ item.pkg_deps }} \
55 {{ item.pkg_content }}
56 [ "{{ item.pkg_type }}" = deb ] && dpkg-deb -c "{{ item.pkg }}" || :
57 [ "{{ item.pkg_type }}" = deb ] && dpkg-deb -I "{{ item.pkg }}" || :
58 [ "{{ item.pkg_type }}" = rpm ] && rpm -qp "{{ item.pkg }}" --info || :
59 pkg:
60 - pkg: "aircrack-ng_{{ pkg_deb_revision }}_amd64.deb"
61 pkg_name: aircrack-ng
62 pkg_type: deb
63 pkg_template: "aircrack-ng_VERSION_ARCH.deb"
64 pkg_deps: "--category net --deb-priority optional -d iw -d wireless-tools -d ethtool -d usbutils -d rfkill -d libc6 -d libgcc1 -d libltdl7 -d libnl-3-200 -d libnl-genl-3-200 -d libstdc++6"
65 pkg_content: "usr/bin usr/include usr/lib usr/sbin usr/share/man"
66 pkg_version: "{{ pkg_deb_revision }}"
67 - pkg: "aircrack-ng-{{ pkg_rpm_revision }}.x86_64.rpm"
68 pkg_name: aircrack-ng
69 pkg_type: rpm
70 pkg_template: "aircrack-ng-VERSION.ARCH.rpm"
71 pkg_deps: "-d iw -d wireless-tools -d ethtool -d usbutils -d rfkill -d glibc -d libgcc -d libtool-ltdl -d libnl3 -d libstdc++"
72 pkg_content: "usr/bin usr/include usr/lib usr/sbin usr/share/man"
73 pkg_version: "{{ pkg_rpm_revision }}"
74 - command: mktemp -d
75 register: destdir
76 - shell:
77 script: ./evalrev | sed -e 's/_rev//g'
78 register: revision
79 - command: git rev-parse HEAD
80 register: commit_id
81 - command: git rev-parse --abbrev-ref HEAD
82 register: branch
83 - shell:
84 script: 'git describe --abbrev=0 --tags 2>/dev/null || echo unknown'
85 register: closest_tag
86 - shell:
87 script: 'git describe --abbrev=0 --tags --exact-match 2>/dev/null || echo'
88 register: exact_tag
89 - command: date -u +%Y%m%d%H%M%S
90 register: pkg_date
91
92 # Development package naming
93 - name: Calculating the Debian package version
94 command: echo {{ closest_tag }}+git{{ pkg_date }}-1
95 register: pkg_deb_revision
96 when: "exact_tag | trim | count == 0"
97 - name: Calculating the RPM package version
98 shell:
99 script: echo {{ closest_tag }}.{% print pkg_date.stdout[:8] %}git$(git rev-parse --short HEAD)
100 register: pkg_rpm_revision
101 when: "exact_tag | trim | count == 0"
102
103 # Stable package naming
104 - name: Calculating the Debian package version
105 command: echo {{ exact_tag }}-1
106 register: pkg_deb_revision
107 when: "exact_tag | trim | count > 0"
108 - name: Calculating the RPM package version
109 shell:
110 script: echo {{ exact_tag }}
111 register: pkg_rpm_revision
112 when: "exact_tag | trim | count > 0"
113
114 - name: Metadata Evaluation
115 echo: |
116 destdir : {{ destdir }}
117 revision : {{ revision }}
118 commit : {{ commit_id }}
119 branch : {{ branch }}
120 closest_tag : {{ closest_tag }}
121 exact_tag : {{ exact_tag }}
122 pkg_date : {{ pkg_date }}
123 pkg_deb_revision: {{ pkg_deb_revision }}
124 pkg_rpm_revision: {{ pkg_rpm_revision }}
125
126 - name: Packaging Build
127 tags:
128 - pkg
129 stage:
130 tasks:
131 - name: Clean build artifacts
132 shell:
133 script: |
134 find . -name '.deps' -a -type d -exec rm -fr {} ';' 2>/dev/null || :
135 find . -name '.libs' -a -type d -exec rm -fr {} ';' 2>/dev/null || :
136 silent: true
137
138 - name: Ensure configure is present
139 command: autoreconf -vi
140
141 - name: Configure
142 command: >
143 ./configure --prefix=/usr
144 --with-experimental
145 --enable-static-crypto
146 --enable-static-hwloc
147 --enable-static-sqlite3
148 --enable-static-pcre2
149 --enable-static-pcap
150
151 - name: Make clean
152 shell:
153 script: make clean
154 silent: true
155
156 - name: Compile
157 shell:
158 script: make V=1
159 silent: true
160
161 - name: Run unit-tests
162 command: make check
163
164 - name: Staging Installation
165 command: "make install-strip DESTDIR={{ destdir }}"
166
167 - name: Produce dist artifacts
168 command: make dist
169
170 - name: Packaging
171 shell:
172 script: "{{ fpm }}"
173 with_items: "{{ pkg }}"
174
175 - name: Packaging Deployment
176 tags:
177 - deploy
178 stage:
179 tasks:
180 - name: Deploying development packages to the web server
181 tags:
182 - www
183 stage:
184 tasks:
185 - shell:
186 script: |
187 {% set path = "{{ www }}/{{ artifacts }}/development/{{ commit_id }}/{{ item.pkg_type }}" %}
188 {% set prefix = "{{ www }}/{{ artifacts }}" %}
189 mkdir -p "{{ path }}"
190 chmod 777 "{{ www }}/{{ artifacts }}/development/{{ commit_id }}"
191 chmod 777 "{{ path }}"
192 ( cd "{{ prefix }}/development" && ln -sfnd "{{ commit_id }}" "{{ branch }}" )
193 cp -p "{{ item.pkg }}" "{{ path }}"
194 chmod 664 "{{ path }}/{{ item.pkg }}"
195 with_items: "{{ pkg }}"
196
197 - shell:
198 script: |
199 {% set path = "{{ www }}/{{ artifacts }}/development/{{ commit_id }}" %}
200 find . -name '*.zip' -o -name '*.tar.*' -print0 | xargs -0 -I {} cp -p {} "{{ path }}"
201
202 - name: Deploying development package manifest
203 tags:
204 - www
205 shell:
206 script: |
207 mkdir -p "{{ www }}/{{ artifacts }}"
208 cat > "{{ www }}/{{ artifacts }}/development.json" <<-EOF
209 {
210 "build": "development",
211 "commit": "{{ commit_id }}",
212 "tag": "{{ closest_tag }}",
213 "date": "$(date -u)",
214 "url": "https://packages.aircrack-ng.org/artifacts/aircrack-ng/development/{{ commit_id }}"
215 }
216 EOF
217
218 - name: Deploying stable packages to the web server
219 tags:
220 - www
221 shell:
222 script: |
223 {% set prefix = "{{ www }}/{{ artifacts }}" %}
224 mkdir -p "{{ prefix }}/stable"
225 chmod 777 "{{ prefix }}/stable"
226 ( cd "{{ prefix }}/stable" && ln -sfnd "../development/{{ commit_id }}" "{{ exact_tag }}" )
227 when: "exact_tag | trim | count > 0"
228
229 - name: Deploying stable package manifest
230 tags:
231 - www
232 shell:
233 script: |
234 cat > "{{ www }}/{{ artifacts }}/stable.json" <<-EOF
235 {
236 "build": "stable",
237 "commit": "{{ commit_id }}",
238 "tag": "{{ exact_tag }}",
239 "date": "$(date -u)",
240 "url": "https://packages.aircrack-ng.org/artifacts/aircrack-ng/stable/{{ exact_tag }}"
241 }
242 EOF
243 when: "exact_tag | trim | count > 0"
244
245 - name: Deploying development packages to PackageCloud.io
246 tags:
247 - package_cloud
248 matrix:
249 tags:
250 - deb
251 - rpm
252 tasks:
253 - name: Deploy Debian Packages
254 when: "matrix_tag == 'deb'"
255 matrix:
256 tags:
257 - any/any
258 tasks:
259 - command: "package_cloud push --yes aircrack-ng/git/{{ matrix_tag }} {{ item.pkg }}"
260 with_items: "{{ pkg | selectattr('pkg_type', 'equalto', 'deb') | list }}"
261
262 - command: "package_cloud push --yes aircrack-ng/release/{{ matrix_tag }} {{ item.pkg }}"
263 when: "exact_tag | trim | count > 0"
264 with_items: "{{ pkg | selectattr('pkg_type', 'equalto', 'deb') | list }}"
265
266 - name: Deploy RPM Packages
267 when: "matrix_tag == 'rpm'"
268 matrix:
269 tags:
270 - rpm_any/rpm_any
271 tasks:
272 - command: "package_cloud push --yes aircrack-ng/git/{{ matrix_tag }} {{ item.pkg }}"
273 with_items: "{{ pkg | selectattr('pkg_type', 'equalto', 'rpm') | list }}"
274
275 - command: "package_cloud push --yes aircrack-ng/release/{{ matrix_tag }} {{ item.pkg }}"
276 when: "exact_tag | trim | count > 0"
277 with_items: "{{ pkg | selectattr('pkg_type', 'equalto', 'rpm') | list }}"
278