Debian Directory: Difference between revisions
From charlesreid1
(Created page with "Mysterious. Chapter 5: https://www.debian.org/doc/manuals/maint-guide/dother.en.html Chapter 6: https://www.debian.org/doc/manuals/maint-guide/build.en.html Here's what you...") |
No edit summary |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
<pre> | <pre> | ||
apt-get install debhelper | apt-get install debhelper dh-make | ||
</pre> | </pre> | ||
| Line 18: | Line 18: | ||
<pre> | <pre> | ||
dpkg-buildpackage -us -uc | dpkg-buildpackage -us -uc -b | ||
</pre> | </pre> | ||
via man page (https://linux.die.net/man/1/dpkg-source), the -b with an empty string will build a Debian package. That means, it DOES NOT need a tar gz file. | |||
<pre> | |||
Build options (with -b): | |||
If a second non-option argument is supplied it should be the name of the original source directory or tarfile or the empty string if the package is a Debian-specific one and so has no Debianisation diffs. If no second argument is supplied then dpkg-source will look for the original source tarfile package_upstream-version.orig.tar.gz or the original source directory directory.orig depending on the -sX arguments. | |||
</pe> | |||
==Example== | |||
For installing john: | |||
<pre> | |||
$ dpkg-buildpackage -us -uc -b | |||
dpkg-buildpackage: info: source package john | |||
dpkg-buildpackage: info: source version 1.8.0-2 | |||
dpkg-buildpackage: info: source distribution unstable | |||
dpkg-buildpackage: info: source changed by Julián Moreno Patiño <julian@debian.org> | |||
dpkg-buildpackage: info: host architecture amd64 | |||
dpkg-source --before-build john | |||
dpkg-source: info: applying allow-cflags-overriding.diff | |||
dpkg-source: info: applying arm-unroll-loops-ftbfs-476460.diff | |||
dpkg-source: info: applying kfreebsd-c3_fmt.diff | |||
dpkg-source: info: applying define-cfg-name.diff | |||
fakeroot debian/rules clean | |||
dh clean --sourcedirectory=src | |||
dh_testdir -O--sourcedirectory=src | |||
debian/rules override_dh_auto_clean | |||
make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' | |||
dh_auto_clean | |||
make -j1 clean | |||
make[2]: Entering directory '/home/charles/codes/kali-tools/dist/john/src' | |||
rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exe | |||
rm -f ../run/john.exe john-macosx-* *.o *.bak core | |||
rm -f detect bench generic.h arch.h tmp.s | |||
cp /dev/null Makefile.dep | |||
make[2]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' | |||
# script-not-executable | |||
chmod +x debian/extra/cronjob | |||
make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' | |||
dh_clean -O--sourcedirectory=src | |||
debian/rules build | |||
dh build --sourcedirectory=src | |||
dh_testdir -O--sourcedirectory=src | |||
dh_update_autotools_config -O--sourcedirectory=src | |||
dh_auto_configure -O--sourcedirectory=src | |||
debian/rules override_dh_auto_build | |||
make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' | |||
# building the selected target | |||
dh_auto_build -- clean linux-x86-64 | |||
make -j1 clean linux-x86-64 | |||
make[2]: Entering directory '/home/charles/codes/kali-tools/dist/john/src' | |||
rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exe | |||
rm -f ../run/john.exe john-macosx-* *.o *.bak core | |||
rm -f detect bench generic.h arch.h tmp.s | |||
cp /dev/null Makefile.dep | |||
ln -sf x86-64.h arch.h | |||
...snip... | |||
ln -s john ../run/unshadow | |||
rm -f ../run/unafs | |||
ln -s john ../run/unafs | |||
rm -f ../run/unique | |||
ln -s john ../run/unique | |||
make[3]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' | |||
make[2]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' | |||
make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' | |||
create-stamp debian/debhelper-build-stamp | |||
fakeroot debian/rules binary | |||
dh binary --sourcedirectory=src | |||
create-stamp debian/debhelper-build-stamp | |||
dh_testroot -O--sourcedirectory=src | |||
dh_prep -O--sourcedirectory=src | |||
debian/rules override_dh_auto_install | |||
make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' | |||
# install the selected target | |||
dh_auto_install | |||
# install fallbacks as needed | |||
make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' | |||
dh_install -O--sourcedirectory=src | |||
dh_installdocs -O--sourcedirectory=src | |||
dh_installchangelogs -O--sourcedirectory=src | |||
dh_installman -O--sourcedirectory=src | |||
dh_installcron -O--sourcedirectory=src | |||
dh_perl -O--sourcedirectory=src | |||
dh_link -O--sourcedirectory=src | |||
dh_strip_nondeterminism -O--sourcedirectory=src | |||
dh_compress -O--sourcedirectory=src | |||
dh_fixperms -O--sourcedirectory=src | |||
dh_strip -O--sourcedirectory=src | |||
dh_makeshlibs -O--sourcedirectory=src | |||
dh_shlibdeps -O--sourcedirectory=src | |||
dh_installdeb -O--sourcedirectory=src | |||
dh_gencontrol -O--sourcedirectory=src | |||
dh_md5sums -O--sourcedirectory=src | |||
dh_builddeb -O--sourcedirectory=src | |||
dpkg-deb: building package 'john-data' in '../john-data_1.8.0-2_all.deb'. | |||
dpkg-deb: building package 'john' in '../john_1.8.0-2_amd64.deb'. | |||
dpkg-genbuildinfo --build=binary | |||
dpkg-genchanges --build=binary >../john_1.8.0-2_amd64.changes | |||
dpkg-genchanges: info: binary-only upload (no source code included) | |||
dpkg-source --after-build john | |||
dpkg-source: info: unapplying define-cfg-name.diff | |||
dpkg-source: info: unapplying kfreebsd-c3_fmt.diff | |||
dpkg-source: info: unapplying arm-unroll-loops-ftbfs-476460.diff | |||
dpkg-source: info: unapplying allow-cflags-overriding.diff | |||
dpkg-buildpackage: info: binary-only upload (no source included) | |||
</pre> | |||
Now, you should be able to see a john .deb file in the parent directory: | |||
<pre> | |||
$ ls ../ | |||
john | |||
john_1.8.0-2_amd64.buildinfo | |||
john_1.8.0-2_amd64.changes | |||
john_1.8.0-2_amd64.deb | |||
john-data_1.8.0-2_all.deb | |||
</pre> | |||
Last step is to install the package with the <code>dpkg -i</code> command: | |||
<pre> | |||
dpkg -i john_1.8.0-2_amd64.deb | |||
dpkg -i john-data_1.8.0-2_all.deb | |||
</pre> | |||
After that, you'll see them in aptitude: | |||
<pre> | |||
$ sudo apt-get install john john-data | |||
Reading package lists... Done | |||
Building dependency tree | |||
Reading state information... Done | |||
john is already the newest version (1.8.0-2+b1). | |||
john-data is already the newest version (1.8.0-2). | |||
john-data set to manually installed. | |||
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. | |||
</pre> | |||
Latest revision as of 07:14, 29 January 2018
Mysterious.
Chapter 5: https://www.debian.org/doc/manuals/maint-guide/dother.en.html
Chapter 6: https://www.debian.org/doc/manuals/maint-guide/build.en.html
Here's what you do:
Start by installing debhelper:
apt-get install debhelper dh-make
Now go to the directory level where the debian/ directory is located. ls debian should show you the contents of the debian directory (source, rules, etc.).
Now run the command to build the debian package (.deb file):
dpkg-buildpackage -us -uc -b
via man page (https://linux.die.net/man/1/dpkg-source), the -b with an empty string will build a Debian package. That means, it DOES NOT need a tar gz file.
Build options (with -b): If a second non-option argument is supplied it should be the name of the original source directory or tarfile or the empty string if the package is a Debian-specific one and so has no Debianisation diffs. If no second argument is supplied then dpkg-source will look for the original source tarfile package_upstream-version.orig.tar.gz or the original source directory directory.orig depending on the -sX arguments. </pe> ==Example== For installing john: <pre> $ dpkg-buildpackage -us -uc -b dpkg-buildpackage: info: source package john dpkg-buildpackage: info: source version 1.8.0-2 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Julián Moreno Patiño <julian@debian.org> dpkg-buildpackage: info: host architecture amd64 dpkg-source --before-build john dpkg-source: info: applying allow-cflags-overriding.diff dpkg-source: info: applying arm-unroll-loops-ftbfs-476460.diff dpkg-source: info: applying kfreebsd-c3_fmt.diff dpkg-source: info: applying define-cfg-name.diff fakeroot debian/rules clean dh clean --sourcedirectory=src dh_testdir -O--sourcedirectory=src debian/rules override_dh_auto_clean make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' dh_auto_clean make -j1 clean make[2]: Entering directory '/home/charles/codes/kali-tools/dist/john/src' rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exe rm -f ../run/john.exe john-macosx-* *.o *.bak core rm -f detect bench generic.h arch.h tmp.s cp /dev/null Makefile.dep make[2]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' # script-not-executable chmod +x debian/extra/cronjob make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' dh_clean -O--sourcedirectory=src debian/rules build dh build --sourcedirectory=src dh_testdir -O--sourcedirectory=src dh_update_autotools_config -O--sourcedirectory=src dh_auto_configure -O--sourcedirectory=src debian/rules override_dh_auto_build make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' # building the selected target dh_auto_build -- clean linux-x86-64 make -j1 clean linux-x86-64 make[2]: Entering directory '/home/charles/codes/kali-tools/dist/john/src' rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exe rm -f ../run/john.exe john-macosx-* *.o *.bak core rm -f detect bench generic.h arch.h tmp.s cp /dev/null Makefile.dep ln -sf x86-64.h arch.h ...snip... ln -s john ../run/unshadow rm -f ../run/unafs ln -s john ../run/unafs rm -f ../run/unique ln -s john ../run/unique make[3]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' make[2]: Leaving directory '/home/charles/codes/kali-tools/dist/john/src' make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' create-stamp debian/debhelper-build-stamp fakeroot debian/rules binary dh binary --sourcedirectory=src create-stamp debian/debhelper-build-stamp dh_testroot -O--sourcedirectory=src dh_prep -O--sourcedirectory=src debian/rules override_dh_auto_install make[1]: Entering directory '/home/charles/codes/kali-tools/dist/john' # install the selected target dh_auto_install # install fallbacks as needed make[1]: Leaving directory '/home/charles/codes/kali-tools/dist/john' dh_install -O--sourcedirectory=src dh_installdocs -O--sourcedirectory=src dh_installchangelogs -O--sourcedirectory=src dh_installman -O--sourcedirectory=src dh_installcron -O--sourcedirectory=src dh_perl -O--sourcedirectory=src dh_link -O--sourcedirectory=src dh_strip_nondeterminism -O--sourcedirectory=src dh_compress -O--sourcedirectory=src dh_fixperms -O--sourcedirectory=src dh_strip -O--sourcedirectory=src dh_makeshlibs -O--sourcedirectory=src dh_shlibdeps -O--sourcedirectory=src dh_installdeb -O--sourcedirectory=src dh_gencontrol -O--sourcedirectory=src dh_md5sums -O--sourcedirectory=src dh_builddeb -O--sourcedirectory=src dpkg-deb: building package 'john-data' in '../john-data_1.8.0-2_all.deb'. dpkg-deb: building package 'john' in '../john_1.8.0-2_amd64.deb'. dpkg-genbuildinfo --build=binary dpkg-genchanges --build=binary >../john_1.8.0-2_amd64.changes dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build john dpkg-source: info: unapplying define-cfg-name.diff dpkg-source: info: unapplying kfreebsd-c3_fmt.diff dpkg-source: info: unapplying arm-unroll-loops-ftbfs-476460.diff dpkg-source: info: unapplying allow-cflags-overriding.diff dpkg-buildpackage: info: binary-only upload (no source included)
Now, you should be able to see a john .deb file in the parent directory:
$ ls ../ john john_1.8.0-2_amd64.buildinfo john_1.8.0-2_amd64.changes john_1.8.0-2_amd64.deb john-data_1.8.0-2_all.deb
Last step is to install the package with the dpkg -i command:
dpkg -i john_1.8.0-2_amd64.deb dpkg -i john-data_1.8.0-2_all.deb
After that, you'll see them in aptitude:
$ sudo apt-get install john john-data Reading package lists... Done Building dependency tree Reading state information... Done john is already the newest version (1.8.0-2+b1). john-data is already the newest version (1.8.0-2). john-data set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.