COMPILAR PAQUETE

Comandos

mkdir linuxconfig dpkg-deb --build linuxconfig
apt install debmake debhelper debmake debuild

Archivos

linuxconfig/DEBIAN/control linuxconfig/usr/local/bin/
debian/control debian/rules debian/README.Debian debian/changelog

popo-0.1.tar.gz debhello-0.0.tar.gz

Codigos

popo.c

#include <stdio.h> int main() { printf("popo.org!\n"); return 0; }

Makefile

prefix = /usr/local all: src/popo src/popo: src/popo.cc @echo "CFLAGS=$(CFLAGS)" | \ fold -s -w 70 | \ sed -e 's/^/# /' $(CC) $(CPPFLAGS) $(CFLAGS) $(LDCFLAGS) -o $@ $^ install: src/popo install -D src/popo \ $(DESTDIR)$(prefix)/bin/popo clean: -rm -f src/popo distclean: clean uninstall: -rm -f $(DESTDIR)$(prefix)/bin/popo .PHONY: all install clean distclean uninstall

debian/rules

#!/usr/bin/make -f # You must remove unused comment lines for the released package. export DH_VERBOSE = 1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh $@ override_dh_auto_install: dh_auto_install -- prefix=/usr override_dh_fixperms: dh_fixperms chmod 777 debian/debhello/usr/bin/hello #override_dh_install: # dh_install --list-missing -X.pyc -X.pyo
man debhelper man dh

Referencias

https://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository

https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html

https://wiki.debian.org/Packaging/Intro?action=show&redirect=IntroDebianPackaging

https://riptutorial.com/makefile

https://www.tutorialspoint.com/makefile/makefile_quick_guide.htm

https://ostechnix.com/how-to-build-debian-packages-from-source/