-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathblackarch-guide-id.tex
778 lines (605 loc) · 24 KB
/
blackarch-guide-id.tex
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Panduan Blackarch Linux %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper, oneside, 11pt]{book}
%%% INCLUDES %%%
\renewcommand{\familydefault}{\sfdefault}
\usepackage{array}
\usepackage{color}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{fancyvrb}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{html}
\usepackage{hyperref}
\usepackage{ifpdf}
\usepackage{listings}
\usepackage{pstricks}
\usepackage{supertabular}
\usepackage{tocloft}
\usepackage[utf8]{inputenc}
%%% LAYOUT %%%
\setlength{\parindent}{0em}
\setlength{\parskip}{1.5ex plus0.5ex minus0.5ex}
\geometry{left=2.5cm, textwidth=16cm, top=3cm, textheight=25cm, bottom=3cm}
\widowpenalty=2000
\clubpenalty=1000
\frenchspacing
\sloppy
\pagecolor[HTML]{FFFFFF}
\color[HTML]{333333}
\setcounter{tocdepth}{10}
\setcounter{secnumdepth}{10}
\hypersetup{
pdftitle={BlackArch Linux, Panduan BlackArch Linux},
pdfsubject={BlackArch Linux, Panduan BlackArch Linux},
pdfauthor={BlackArch Linux, BlackArch Linux},
pdfkeywords={BlackArch Linux, Penetration Testing, Security, Hacking, Linux},
pdfcenterwindow=true,
colorlinks=true,
breaklinks=true,
linkcolor=blue,
menucolor=blue,
urlcolor=blue
}
% syntax highlighting
% all options should be set here document wide
\lstset{
backgroundcolor=\color[HTML]{EEEEEE},
frame=single,
basicstyle=\footnotesize\ttfamily,
float,
deletekeywords={return},
otherkeywords={mkdir, curl, sudo, sha1sum, grep, cut, sort, wget, makepkg,
pacman, blackman, chmod},
keywordstyle=\color{orange},
commentstyle=\color{blue},
stringstyle=\color{red},
language=bash,
showspaces=false,
showtabs=false,
tabsize=2
}
%%% HEADER / FOOTER %%%
\setlength{\headheight}{33pt}
\setlength{\headsep}{33pt}
\lhead{{\includegraphics[width=1cm,height=1cm]{images/logo.png}}}
\rhead{Panduan BlackArch Linux}
%%% CUSTOM MACROS %%%
% for html links
\ifpdf\else
\def\href#1#2{\htmladdnormallink{#2}{#1}}
\fi
%------------------%
% JUDUL HALAMAN %
%------------------%
\begin{document}
\pagestyle{empty}
\begin{center}
\begin{figure}[htbp]
\centering
\vspace{0.5cm}
\includegraphics[width=8cm]{images/logo.png}
\label{fig:logo}
\end{figure}
\vspace{0.5cm}
\Huge{\textbf{Panduan BlackArch Linux}}\\
\vspace{1cm}
\Large{\color{blue}https://www.blackarch.org/}\\
\vspace{0.5cm}
\end{center}
\newpage
\tableofcontents
\newpage
\pagestyle{fancy}
%------------------%
% Bab 1 %
%------------------%
\chapter{Introduction}
\section{Overview}
Panduan BlackArch Linux dibagi menjadi beberapa bagian:
\begin{itemize}
\item Pendahuluan - Memberikan pandangan luas, pendahuluan dan informasi tambahan seputar proyek
\item Panduan Pengguna - Segala sesuatu yang perlu diketahui oleh pengguna untuk menggunakan BlackArch secara efektif
\item Panduan Pengembang - Panduan cara memulai mengembangkan dan berkontribusi pada BlackArch
\item Panduan Tool - Detail tool mendalam beserta contoh penggunaan(WIP)
\end{itemize}
\section{Apa itu BlackArch Linux?}
BlackArch adalah distro Linux lengkap untuk penetration tester dan security researchers.
BlackArch berasal dari \href{https://www.archlinux.org/}{ArchLinux} dan pengguna dapat install komponen-komponen BlackArch
secara masing-masing atau dalam kelompok langsung di atasnya.
Toolset didistribusikan sebagai Arch Linux
\href{https://wiki.archlinux.org/index.php/Unofficial\_User\_Repositories}
{unofficial user repository} sehingga Anda dapat menginstal BlackArch di atas
instalasi Arch Linux yang ada. Paket dapat diinstal secara individual atau dengan
kategori.
Repositori yang terus berkembang saat ini mencakup lebih dari \href{https://www.blackarch.org/tools.html}{2600} alat.
Semua alat diuji secara menyeluruh sebelum ditambahkan ke basis kode untuk menjaga kualitas repositori.
% should quickly describe the testing methods/code review procedures etc
\section{Sejarah BlackArch Linux}
Segera...
\section{Platform yang didukung}
Segera...
\section{Terlibat}
Anda dapat menghubungi tim BlackArch menggunakan jalur berikut:
Website: \url{https://www.blackarch.org/}
Mail: \href{mailto:[email protected]}{[email protected]}
IRC: \url{irc://irc.freenode.net/blackarch}
Twitter: \url{https://twitter.com/blackarchlinux}
Github: \url{https://github.com/Blackarch/}
Discord: \url{https://discord.com/invite/xMHt8dW}
%------------------%
% Chapter 2 %
%------------------%
\chapter{Panduan Pengguna}
\section{Installasi}
Bagian ini akan menunjukkan kepada Anda cara mempersiapkan repositori BlackArch dan
instalasi paket. BlackArch mendukung keduanya, instalasi dari repositori meggunakan
paket biner serta kompilasi dan instalasi dari source.
BlackArch kompatibel dengan instalasi Arch normal. Itu bertindak sebagai repositori
pengguna tidak resmi. Jika anda menginginkan ISO, lihat bagian
\href{https://www.blackarch.org/downloads.html#iso}{ISOs}.
\subsection{Instalasi di atas ArchLinux}
Jalankan \href{https://blackarch.org/strap.sh}{strap.sh} sebagai root dan ikuti
perintah-perintah. Lihat conth berikut.
\begin{lstlisting}
curl -O https://blackarch.org/strap.sh
sha1sum strap.sh # should match: 5ea40d49ecd14c2e024deecf90605426db97ea0c
sudo chmod +x strap.sh
sudo ./strap.sh
\end{lstlisting}
Sekarang unduh salinan baru dari daftar paket master dan sinkronisasi paket:
\begin{lstlisting}
sudo pacman -Syyu
\end{lstlisting}
\subsection{Instalasi paket}
Anda sekarang dapat menginstal alat dari repositori BlackArch.
\begin{enumerate}
\item Untuk melihat daftar semua alat yang tersedia, jalankan
\begin{lstlisting}
pacman -Sgg | grep blackarch | cut -d' ' -f2 | sort -u
\end{lstlisting}
\item Untuk instalasi semua alat, jalankan
\begin{lstlisting}
pacman -S blackarch
\end{lstlisting}
\item Untuk instalasi alat berdasarkan kategori, jalankan
\begin{lstlisting}
pacman -S blackarch-<category>
\end{lstlisting}
\item Untuk melihat kategori blackarch, jalankan
\begin{lstlisting}
pacman -Sg | grep blackarch
\end{lstlisting}
\end{enumerate}
\subsection{Menginstal paket dari sumber}
Sebagai bagian dari metode instalasi alternatif, Anda dapat membangun BlackArch
paket dari sumber. Anda dapat menemukan PKGBUILD di
\href{https://github.com/BlackArch/blackarch/tree/master/packages}{github}. Untuk
membangun seluruh repo, Anda dapat menggunakan
\href{https://github.com/BlackArch/blackman}{Blackman} alat.
\begin{itemize}
\item Pertama, Anda harus menginstal Blackman. Jika repositori paket BlackArch
sudah diatur pada mesin Anda, Anda dapat menginstal Blackman:
\begin{lstlisting}
pacman -S blackman
\end{lstlisting}
\item Anda dapat membangun dan menginstal Blackman dari sumber:
\begin{lstlisting}
mkdir blackman
cd blackman
wget https://raw2.github.com/BlackArch/blackarch/master/packages/blackman/PKGBUILD
# Pastikan PKGBUILD tidak dirusak dengan maksud jahat.
makepkg -s
\end{lstlisting}
\item Atau Anda dapat menginstal Blackman dari AUR:
\begin{lstlisting}
<apa pun penolong AUR yang Anda gunakan> -S blackman
\end{lstlisting}
\end{itemize}
\subsection{Penggunaan dasar Blackman} Blackman sangat mudah digunakan, meskipun benderanya berbeda dari Anda
biasanya diharapkan dari sesuatu seperti pacman. Penggunaan dasar telah diuraikan di bawah ini.
\begin{itemize}
\item Unduh, kompilasi, dan instal paket:
\begin{lstlisting}
sudo blackman -i paket
\end{lstlisting}
\item Unduh, kompilasi, dan instal seluruh kategori:
\begin{lstlisting}
sudo blackman -g kelompok
\end{lstlisting}
\item Unduh, kompilasi, dan instal semua alat BlackArch:
\begin{lstlisting}
sudo blackman -a
\end{lstlisting}
\item Untuk membuat daftar kategori blackarch:
\begin{lstlisting}
blackman -l
\end{lstlisting}
\item Untuk membuat daftar alat katagori:
\begin{lstlisting}
blackman -p kategori
\end{lstlisting}
\end{itemize}
\subsection{Menginstal dari full-, netinstall- ISO atau ArchLinux}
Anda dapat menginstal Blackarch Linux dari salah satu live- atau netinstall-ISO kami.\\See
\url{https://www.blackarch.org/download.html#iso}. Langkah-langkah berikut
diperlukan setelah ISO boot.
\begin{itemize}
\item Install blackarch-installer package:
\begin{lstlisting}
sudo pacman -S blackarch-installer
\end{lstlisting}
\item Run
\begin{lstlisting}
sudo blackarch-install
\end{lstlisting}
\end{itemize}
%------------------%
% Chapter 3 %
%------------------%
\chapter{Developer Guide}
\section{Arch's Build System and Repositories}
PKGBUILD files are build scripts. Each one tells makepkg(1) how to create a
package. PKGBUILD files are written in Bash.
For more information, read (or skim through) the following:
\begin{itemize}
\item \href{https://wiki.archlinux.org/index.php/Creating_Packages}{Arch Wiki: Creating Packages}
\item \href{https://wiki.archlinux.org/index.php/Makepkg}{Arch Wiki: makepkg}
\item \href{https://wiki.archlinux.org/index.php/PKGBUILD}{Arch Wiki: PKGBUILD}
\item \href{https://wiki.archlinux.org/index.php/Arch_Packaging_Standards}{Arch Wiki: Arch Packaging Standards}
\end{itemize}
\section{Blackarch PKGBUILD standards}
For the sake of simplicity, our PKGBUILDs are similar to that of the AUR ones,
with a few small differences outlined below. Every package must
belong to blackarch at the minimum, there will also be a lot of crossover with
multiple packages belonging to multiple groups.
\subsection{Groups}
To allow users to install a specific range of packages quickly and easily,
packages have been separated into groups. Groups allow users to simply
go "pacman -S <group name>" in order to pull a lot of packages.
\subsubsection{blackarch}
The blackarch group is the base group that all packages must belong too. This allows
users to install every package with ease.
What should be in here: Everything.
\subsubsection{blackarch-anti-forensic}
Packages that are used for countering forensic activities,
including encryption, steganography, and anything that modifies files/file attributes.
This all includes tools to work with anything in general that makes changes to a system
for the purposes of hiding information.
Examples: luks, TrueCrypt, Timestomp, dd, ropeadope, secure-delete
\subsubsection{blackarch-automation}
Packages that are used for tool or workflow automation.
Examples: blueranger, tiger, wiffy
\subsubsection{blackarch-backdoor}
Packages that exploit or open backdoors on already vulnerable systems.
Examples: backdoor-factory, rrs, weevely
\subsubsection{blackarch-binary}
Packages that operate on binary files in some form.
Examples: binwally, packerid
\subsubsection{blackarch-bluetooth}
Packages that exploit anything concerning the Bluetooth standard (802.15.1).
Examples: ubertooth, tbear, redfang
\subsubsection{blackarch-code-audit}
Packages that audit existing source code for vulnerability analysis.
Examples: flawfinder, pscan
\subsubsection{blackarch-cracker}
Packages used for cracking cryptographic functions, ie hashes.
Examples: hashcat, john, crunch
\subsubsection{blackarch-crypto}
Packages that work with cryptography, with the exception of cracking.
Examples: ciphertest, xortool, sbd
\subsubsection{blackarch-database}
Packages that involve database exploitations on any level.
Examples: metacoretex, blindsql
\subsubsection{blackarch-debugger}
Packages that allow the user to view what a particular program is "doing" in realtime.
Examples: radare2, shellnoob
\subsubsection{blackarch-decompiler}
Packages that attempt to reverse a compiled program into source code.
Examples: flasm, jd-gui
\subsubsection{blackarch-defensive}
Packages that are used to protect a user from malware \& attacks from other users.
Examples: arpon, chkrootkit, sniffjoke
\subsubsection{blackarch-disassembler}
This is similar to blackarch-decompiler, and there will probably be a lot
of programs that fall into both, however these packages produce assembly output
rather than the raw source code.
Examples: inguma, radare2
\subsubsection{blackarch-dos}
Packages that use DoS (Denial of Service) attacks.
Examples: 42zip, nkiller2
\subsubsection{blackarch-drone}
Packages that are used for managing physically engineered
drones.
Examples: meshdeck, skyjack
\subsubsection{blackarch-exploitation}
Packages that takes advantages of exploits in other programs or services.
Examples: armitage, metasploit, zarp
\subsubsection{blackarch-fingerprint}
Packages that exploit fingerprint biometric equipment.
Examples: dns-map, p0f, httprint
\subsubsection{blackarch-firmware}
Packages that exploit vulnerabilities in firmware
Examples: None yet, amend asap.
\subsubsection{blackarch-forensic}
Packages that are used to find data on physical disks or embedded memory.
Examples: aesfix, nfex, wyd
\subsubsection{blackarch-fuzzer}
Packages that use the fuzz testing principle, ie
"throwing" random inputs at the subject to see what happens.
Examples: msf, mdk3, wfuzz
\subsubsection{blackarch-hardware}
Packages that exploit or manage anything to do with
physical hardware.
Examples: arduino, smali
\subsubsection{blackarch-honeypot}
Packages that act as "honeypots", ie programs that appear to
be vulnerable services used to attract hackers into a trap.
Examples: artillery, bluepot, wifi-honey
\subsubsection{blackarch-keylogger}
Packages that record and retain keystrokes on another system.
Examples: None yet, amend asap.
\subsubsection{blackarch-malware}
Packages that count as any type of malicious software or
malware detection.
Examples: malwaredetect, peepdf, yara
\subsubsection{blackarch-misc}
Packages that don't particularly fit into any categories.
Examples: oh-my-zsh-git, winexe, stompy
\subsubsection{blackarch-mobile}
Packages that manipulate mobile platforms.
Examples: android-sdk-platform-tools, android-udev-rules
\subsubsection{blackarch-networking}
Package that involve IP networking.
Examples: Anything pretty much
\subsubsection{blackarch-nfc}
Packages that use nfc (near-field communications).
Examples: nfcutils
\subsubsection{blackarch-packer}
Packages that operate on or invlove packers.
\textit{packers are programs that embed malware within other executables.}
Examples: packerid
\subsubsection{blackarch-proxy}
Packages that acts as a proxy, ie redirecting traffic
through another node on the internet.
Examples: burpsuite, ratproxy, sslnuke
\subsubsection{blackarch-recon}
Packages that actively seeks vulnerable exploits in the
wild. More of an umbrella group for similar packages.
Examples: canri, dnsrecon, netmask
\subsubsection{blackarch-reversing}
This is an umbrella group for any decompiler,
disassembler or any similar program.
Examples: capstone, radare2, zerowine
\subsubsection{blackarch-scanner}
Packages that scan selected systems for vulnerabilities.
Examples: scanssh, tiger, zmap
\subsubsection{blackarch-sniffer}
Packages that involve analyzing network traffic.
Examples: hexinject, pytactle, xspy
\subsubsection{blackarch-social}
Packages that primarily attack social networking sites.
Examples: jigsaw, websploit
\subsubsection{blackarch-spoof}
Packages that attempt to spoof the attacker such, in that
the attacker doesn't show up as an attacker to the victim.
Examples: arpoison, lans, netcommander
\subsubsection{blackarch-threat-model}
Packages that would be used for reporting/recording the
threat model outlined in a particular scenario.
Examples: magictree
\subsubsection{blackarch-tunnel}
Packages that are used to tunnel network traffic on a given
network.
Examples: ctunnel, iodine, ptunnel
\subsubsection{blackarch-unpacker}
Packages that are used to extract pre-packed malware from an
executable.
Examples: js-beautify
\subsubsection{blackarch-voip}
Packages that operate on voip programs and protocols.
Examples: iaxflood, rtp-flood, teardown
\subsubsection{blackarch-webapp}
Packages that operate on internet-facing applications.
Examples: metoscan, whatweb, zaproxy
\subsubsection{blackarch-windows}
This group is for any native Windows package that runs via wine.
Examples: 3proxy-win32, pwdump, winexe
\subsubsection{blackarch-wireless}
Packages that operates on wireless networks on any level.
Examples: airpwn, mdk3, wiffy
\section{Repository structure}
You can find the main BlackArch git repo here:
\href{https://github.com/BlackArch/blackarch}{https://github.com/BlackArch/blackarch}.
There are also several secondary repos here:
\href{https://github.com/BlackArch}{https://github.com/BlackArch}.
Within the main git repo, there are three important directories:
\begin{itemize}
\item docs - Documentation.
\item packages - PKGBUILD files.
\item scripts - Useful little scripts.
\end{itemize}
\subsection{Scripts}
Here is a reference for scripts in the \verb|scripts/| directory:
\begin{itemize}
\item baaur - Soon, this will upload packages to the AUR.
\item babuild - Build a package.
\item bachroot - Manage a chroot for testing.
\item baclean - Clean old .pkg.tar.xz files from the package repo.
\item baconflict - Soon this will replace \verb|scripts/conflicts|.
\item bad-files - Find bad files in built packages.
\item balock - Obtain or release the package repo lock.
\item banotify - Notify IRC about package pushes.
\item barelease - Release packages to the package repo.
\item baright - Print the BlackArch copyright info.
\item basign - Sign packages.
\item basign-key - Sign a key.
\item blackman - This behaves sort of like pacman but builds from git (not to be
confused with nrz's Blackman).
\item check-groups - Check groups.
\item checkpkgs - Check packages for errors.
\item conflicts - Check for file conflicts.
\item dbmod - Modify a package database.
\item depth-list - Create a list sorted by dependency depth.
\item deptree - Create a dependency tree, listing only blackarch-provided packages.
\item get-blackarch-deps - Get a list of blackarch dependencies for a package.
\item get-official - Get official packages for release.
\item list-loose-packages - List packages that are not in groups and are not
dependencies for other packages.
\item list-needed - List missing dependencies.
\item list-removed - List packages that are in the package repo but not in git.
\item list-tools - List tools.
\item outdated - Look for packages that are out-dated in the package repo
relative to the git repo.
\item pkgmod - Modify a build package.
\item pkgrel - Increment pkgrel in a package.
\item prep - Clean up a PKGBUILD file's style and find errors.
\item sitesync - Sync between a local copy of the package repo and a remote copy.
\item size-hunt - Hunt for large packages.
\item source-backup - Backup package source files.
\end{itemize}
\section{Contributing to repository}
This section shows you how to contribute to the BlackArch Linux project. We
accept pull requests of all sizes, from tiny typo fixes to new packages.\\For
help, suggestions, or questions feel free to contact us.
\\\\
Everyone is welcome to contribute. All contributions are appreciated.
\subsection{Required tutorials}
Please read the following tutorials before contributing:
\begin{itemize}
\item
\href{https://wiki.archlinux.org/index.php/Arch\_Packaging\_Standards)}{Arch
Packaging Standards}
\item \href{https://wiki.archlinux.org/index.php/Creating\_Packages}{Creating
Packages}
\item \href{https://wiki.archlinux.org/index.php/PKGBUILD}{PKGBUILD}
\item \href{https://wiki.archlinux.org/index.php/Makepkg}{Makepkg}
\end{itemize}
\subsection{Steps for contributing}
In order to submit your changes to the BlackArchLinux project, follow these
steps:
\begin{enumerate}
\item Fork the repository from
\url{https://github.com/BlackArch/blackarch}
\item Hack the necessary files, (e.g. PKGBUILD, .patch files, etc).
\item Commit your changes.
\item Push your changes.
\item Ask us to merge in your changes, preferably through a pull request.
\end{enumerate}
\subsection{Example}
The following example demonstrates submitting a new package to the BlackArch
project. We use \href{https://wiki.archlinux.org/index.php/yaourt}{yaourt}
(you can use pacaur as well) to fetch a pre-existing PKGBUILD file for
\textbf{nfsshell} from the \href{https://aur.archlinux.org/}{AUR} and adjust it
according to our needs.
\subsubsection{Fetch PKGBUILD}
Fetch the \textit{PKGBUILD} file using yaourt or pacaur:
\begin{lstlisting}
user@blackarchlinux $ yaourt -G nfsshell
==> Download nfsshell sources
x LICENSE
x PKGBUILD
x gcc.patch
user@blackarchlinux $ cd nfsshell/
\end{lstlisting}
\subsubsection{Clean up PKGBUILD}
Clean up the \textit{PKGBUILD} file and save some time:
\begin{lstlisting}
user@blackarchlinux nfsshell $ ./blackarch/scripts/prep PKGBUILD
cleaning 'PKGBUILD'...
expanding tabs...
removing vim modeline...
removing id comment...
removing contributor and maintainer comments...
squeezing extra blank lines...
removing '|| return'...
removing leading blank line...
removing $pkgname...
removing trailing whitespace...
\end{lstlisting}
\subsubsection{Adjust PKGBUILD}
Adjust the \textit{PKGBUILD} file:
\begin{lstlisting}
user@blackarchlinux nfsshell $ vi PKGBUILD
\end{lstlisting}
\subsubsection{Build the package}
Build the package:
\begin{lstlisting}user@blackarchlinux nfsshell $ makepkg -sf
==> Making package: nfsshell 19980519-1 (Mon Dec 2 17:23:51 CET 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading nfsshell.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time
CurrentDload Upload Total Spent Left Speed100 29213 100 29213 0
0 48150 0 --:--:-- --:--:-- --:--:-- 48206
-> Found gcc.patch
-> Found LICENSE
...
<lots of build process and compiler output here>
...
==> Leaving fakeroot environment.
==> Finished making: nfsshell 19980519-1 (Mon Dec 2 17:23:53 CET 2013)
\end{lstlisting}
\subsubsection{Install and test the package}
Install and test the package:
\begin{lstlisting}
user@blackarchlinux nfsshell $ pacman -U nfsshell-19980519-1-x86_64.pkg.tar.xz
user@blackarchlinux nfsshell $ nfsshell # test it
\end{lstlisting}
\subsubsection{Add, commit and push package}
Add, commit and push the package
\begin{lstlisting}user@blackarchlinux nfsshell $ cd /blackarchlinux/packages
user@blackarchlinux ~/blackarchlinux/packages $ mv ~/nfsshell .
user@blackarchlinux ~/blackarchlinux/packages $ git commit -am nfsshell && git push
\end{lstlisting}
\subsubsection{Create a pull request}
Create a pull request on \href{https://github.com/}{github.com}
\begin{lstlisting}
firefox https://github.com/<contributor>/blackarchlinux
\end{lstlisting}
\subsubsection{Adding a remote for upstream}
A smart thing to do if you're working upstream and on a fork is to pull your own fork and add the main ba repo as a remote
\begin{lstlisting}
user@blackarchlinux ~/blackarchlinux $ git remote -v
origin <the url of your fork> (fetch)
origin <the url of your fork> (push)
user@blackarchlinux ~/blackarchlinux $ git remote add upstream https://github.com/blackarch/blackarch
user@blackarchlinux ~/blackarchlinux $ git remote -v
origin <the url of your fork> (fetch)
origin <the url of your fork> (push)
upstream https://github.com/blackarch/blackarch (fetch)
upstream https://github.com/blackarch/blackarch (push)
\end{lstlisting}
By default, git should push straight to origin, but make sure your git config is
configured correctly. This won't be an issue unless you have commit rights as
you won't be able to push upstream without them.
If you do have the ability to commit, you might have more success using
\textit{[email protected]:blackarch/blackarch.git} but it's up to you.
\subsection{Requests}
\begin{enumerate}
\item Don't add \textbf{Maintainer} or \textbf{Contributor} comments to
\textit{PKGBUILD} files. Add maintainer and contributor names to the
AUTHORS section of BlackArch guide.
\item For the sake of consistency, please follow the general style of the other
\textit{PKGBUILD} files in the repo and use two-space indentation.
\end{enumerate}
\subsection{General tips}
\href{http://wiki.archlinux.org/index.php/Namcap}{namcap} can check packages for
errors.
%------------------%
% Chapter 4 %
%------------------%
\chapter{Tools Guide}
Coming soon...
\section{Coming Soon}
Coming soon...
%%% APPENDIX %%%
\appendix
\include{latex/appendix}
\end{document}
%%% EOF %%%