| 1 |
MUNGE=xargs perl -i.bak -ne ' \ |
| 2 |
print $$_."\# This file was preprocessed, do not edit!\n" \ |
| 3 |
if m:^\#!/usr/bin/perl:; \ |
| 4 |
$$cutting=1 if /^=/; \ |
| 5 |
$$cutting="" if /^=cut/; \ |
| 6 |
next if /use lib/; \ |
| 7 |
next if $$cutting || /^(=|\s*\#)/; \ |
| 8 |
print $$_ \ |
| 9 |
' |
| 10 |
|
| 11 |
all: |
| 12 |
$(MAKE) -C doc |
| 13 |
$(MAKE) -C po |
| 14 |
convert debian-logo.png debian-logo.bmp |
| 15 |
|
| 16 |
clean: |
| 17 |
find . \( -name \*~ -o -name \*.pyc -o -name \*.pyo \) | xargs rm -f |
| 18 |
rm -rf __pycache__ |
| 19 |
rm -f debian-logo.bmp |
| 20 |
$(MAKE) -C doc clean |
| 21 |
$(MAKE) -C po clean |
| 22 |
|
| 23 |
# Does not attempt to install documentation, as that can be fairly system |
| 24 |
# specific. |
| 25 |
install: install-utils install-python3 install-rest |
| 26 |
|
| 27 |
# Anything that goes in the debconf-utils package. |
| 28 |
install-utils: |
| 29 |
install -d $(prefix)/usr/bin |
| 30 |
find . -maxdepth 1 -perm /100 -type f -name 'debconf-*' | grep -v debconf-set-selections | grep -v debconf-show | grep -v debconf-copydb | grep -v debconf-communicate | grep -v debconf-apt-progress | grep -v debconf-escape | \ |
| 31 |
xargs -i install {} $(prefix)/usr/bin |
| 32 |
|
| 33 |
# Anything that goes in the debconf-i18n package. |
| 34 |
install-i18n: |
| 35 |
$(MAKE) -C po install |
| 36 |
|
| 37 |
PERL := perl |
| 38 |
PERL_VENDORLIB := $(shell $(PERL) -MConfig -e 'print $$Config{vendorlib}') |
| 39 |
|
| 40 |
# The Python 3 package. |
| 41 |
install-python3: |
| 42 |
install -d $(prefix)/usr/lib/python3/dist-packages |
| 43 |
install -m 0644 debconf.py $(prefix)/usr/lib/python3/dist-packages/ |
| 44 |
|
| 45 |
# Install all else. |
| 46 |
install-rest: |
| 47 |
install -d $(prefix)/etc \ |
| 48 |
$(prefix)/var/cache/debconf \ |
| 49 |
$(prefix)/usr/share/debconf \ |
| 50 |
$(prefix)/usr/share/pixmaps |
| 51 |
install -m 0644 debconf.conf $(prefix)/etc/ |
| 52 |
install -m 0644 debian-logo.png $(prefix)/usr/share/pixmaps/ |
| 53 |
install -m 0644 debian-logo.bmp $(prefix)/usr/share/pixmaps/ |
| 54 |
# This one is the ultimate backup copy. |
| 55 |
grep -v '^#' debconf.conf > $(prefix)/usr/share/debconf/debconf.conf |
| 56 |
# Make module directories. |
| 57 |
find Debconf -type d |grep -v CVS | \ |
| 58 |
xargs -i install -d $(prefix)/$(PERL_VENDORLIB)/{} |
| 59 |
# Install modules. |
| 60 |
find Debconf -type f -name '*.pm' |grep -v CVS | \ |
| 61 |
xargs -i install -m 0644 {} $(prefix)/$(PERL_VENDORLIB)/{} |
| 62 |
# Special case for back-compatability. |
| 63 |
install -d $(prefix)/$(PERL_VENDORLIB)/Debian/DebConf/Client |
| 64 |
cp Debconf/Client/ConfModule.stub \ |
| 65 |
$(prefix)/$(PERL_VENDORLIB)/Debian/DebConf/Client/ConfModule.pm |
| 66 |
# Other libs and helper stuff. |
| 67 |
install -m 0644 confmodule.sh confmodule $(prefix)/usr/share/debconf/ |
| 68 |
install frontend $(prefix)/usr/share/debconf/ |
| 69 |
install -m 0755 fix_db.pl $(prefix)/usr/share/debconf/ |
| 70 |
# Install essential programs. |
| 71 |
install -d $(prefix)/usr/sbin $(prefix)/usr/bin |
| 72 |
find . -maxdepth 1 -perm /100 -type f -name 'dpkg-*' | \ |
| 73 |
xargs -i install {} $(prefix)/usr/sbin |
| 74 |
find . -maxdepth 1 -perm /100 -type f -name debconf -or -name debconf-show -or -name debconf-copydb -or -name debconf-communicate -or -name debconf-set-selections -or -name debconf-apt-progress -or -name debconf-escape | \ |
| 75 |
xargs -i install {} $(prefix)/usr/bin |
| 76 |
# Now strip all pod documentation from all .pm files and scripts. |
| 77 |
find $(prefix)/$(PERL_VENDORLIB)/ $(prefix)/usr/sbin \ |
| 78 |
$(prefix)/usr/share/debconf/frontend \ |
| 79 |
$(prefix)/usr/share/debconf/*.pl $(prefix)/usr/bin \ |
| 80 |
-name '*.pl' -or -name '*.pm' -or -name 'dpkg-*' -or \ |
| 81 |
-name 'debconf-*' -or -name 'frontend' | \ |
| 82 |
grep -v Client/ConfModule | $(MUNGE) |
| 83 |
find $(prefix) -name '*.bak' | xargs rm -f |
| 84 |
|
| 85 |
demo: |
| 86 |
PERL5LIB=. ./frontend samples/demo |