2
## toplevel_makefile.dpatch by Henrique M. Holschuh <hmh@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Fixes for upstream toplevel makefile
6
## DP: 1. Add a proper distclean target
7
## DP: 2. Stop wasting resources calling pwd
8
## DP: 3. Do not bork a non-LSB build
9
## DP: 4. Use standard locations and automake/autoconf dir settings
12
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
16
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
17
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
20
-patch) patch $patch_opts -p1 < $0;;
21
-unpatch) patch $patch_opts -p1 -R < $0;;
23
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
30
diff -urNad hplip/Makefile.in /tmp/dpep.TXLUzy/hplip/Makefile.in
31
--- hplip/Makefile.in 2005-01-21 11:41:20.000000000 -0200
32
+++ hplip/Makefile.in 2005-01-21 11:41:44.000000000 -0200
34
exec_prefix = @exec_prefix@
37
+libexecdir = @libexecdir@
40
+sysconfdir = @sysconfdir@
41
+hpsysconfdir = $(sysconfdir)/hp
42
chkconfigdir = @CHKCONFIG_PATH@
43
lsbinstalldir = @LSB_INSTALL_PATH@
46
PROJECT_PATH = prnt prnt/hpijs io/hpiod backend/hp base data scan ui ip scan/sane pcard
51
for i in $(PROJECT_PATH); do \
53
- $(MAKE) $(AM_MAKEFLAGS); \
54
+ $(MAKE) $(AM_MAKEFLAGS) || exit $?; \
60
for i in $(PROJECT_PATH); do \
62
- $(MAKE) $(AM_MAKEFLAGS) install; \
63
+ $(MAKE) $(AM_MAKEFLAGS) install || exit $?; \
66
# Install python files to destdir and remove .py extensions.
67
- $(install_script) $(PYTHON_SOURCES) $(PYTHON_SOURCES2) $(DESTDIR)$(datadir)/$(PACKAGE)
68
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir)/$(PACKAGE)
69
+ $(install_script) $(PYTHON_SOURCES) $(PYTHON_SOURCES2) $(DESTDIR)$(libexecdir)/$(PACKAGE)
70
for i in $(PYTHON_SOURCES); do \
72
- mv $(DESTDIR)$(datadir)/$(PACKAGE)/$$i $(DESTDIR)$(datadir)/$(PACKAGE)/$$newname; \
73
+ mv $(DESTDIR)$(libexecdir)/$(PACKAGE)/$$i $(DESTDIR)$(libexecdir)/$(PACKAGE)/$$newname; \
76
# Install and edit hpiod.conf in destdir.
77
- $(install_data) $(PACKAGE).conf $(DESTDIR)$(datadir)/$(PACKAGE)
78
- echo -e "\n[$(PACKAGE)]\nversion=$(VERSION)\njdprobe=0\n" >> $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).conf
79
- echo -e "[dirs]\nhome=$(datadir)/$(PACKAGE)\n" >> $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).conf
80
+ $(mkinstalldirs) $(DESTDIR)$(hpsysconfdir)
81
+ $(install_data) $(PACKAGE).conf $(DESTDIR)$(hpsysconfdir)
82
+ echo -e "\n[$(PACKAGE)]\nversion=$(VERSION)\njdprobe=0\n" >> $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).conf
83
+ echo -e "[dirs]\nhome=$(libexecdir)/$(PACKAGE)\n" >> $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).conf
85
# Install and edit hpiod.sh in destdir.
86
- $(install_script) $(PACKAGE).sh $(DESTDIR)$(datadir)/$(PACKAGE); \
87
- sed 's:HPIODDIR=:HPIODDIR=$(sbindir):' < $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).sh > $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).tmp; \
88
- sed 's:HPSSDDIR=:HPSSDDIR=$(datadir)/$(PACKAGE):' < $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).tmp > $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).sh; \
89
- rm -f $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).tmp
90
+ $(install_script) $(PACKAGE).sh $(DESTDIR)$(sysconfdir); \
91
+ sed 's:HPIODDIR=:HPIODDIR=$(sbindir):' < $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).sh > $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).tmp; \
92
+ sed 's:HPSSDDIR=:HPSSDDIR=$(prefix)/$(PACKAGE):' < $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).tmp > $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).sh; \
93
+ rm -f $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).tmp
95
# Do full install if not rpm_install. Also only run chkconfig/install_initd if DESTDIR="".
96
if [ "$(rpm_install)" = "no" ]; then \
97
$(mkinstalldirs) $(DESTDIR)/etc/hp; \
98
- ln -sf $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).conf $(DESTDIR)/etc/hp/$(PACKAGE).conf; \
99
+ ln -sf $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).conf /etc/hp/$(PACKAGE).conf; \
100
if [ -d /etc/init.d ]; then \
101
- ln -sf $(DESTDIR)$(datadir)/$(PACKAGE)/$(PACKAGE).sh $(DESTDIR)/etc/init.d/$(PACKAGE); \
102
+ ln -sf $(DESTDIR)$(hpsysconfdir)/$(PACKAGE).sh /etc/init.d/$(PACKAGE); \
103
if [ "$(DESTDIR)" = "" ]; then \
104
if [ -x $(lsbinstalldir)/install_initd ]; then \
105
$(lsbinstalldir)/install_initd $(PACKAGE); \
106
@@ -101,31 +106,41 @@
112
for i in $(PROJECT_PATH); do \
114
- $(MAKE) $(AM_MAKEFLAGS) uninstall; \
115
+ $(MAKE) $(AM_MAKEFLAGS) uninstall || exit $?; \
122
for i in $(PROJECT_PATH); do \
124
- $(MAKE) $(AM_MAKEFLAGS) clean; \
125
+ $(MAKE) $(AM_MAKEFLAGS) clean || exit $?; \
129
+ -$(MAKE) $(AM_MAKEFLAGS) clean
131
+ for i in $(PROJECT_PATH); do \
133
+ $(MAKE) $(AM_MAKEFLAGS) distclean || exit $?; \
135
+ rm -f config.log config.status config.cache
140
rm -rf $(PACKAGE)-$(VERSION)
141
mkdir $(PACKAGE)-$(VERSION)
144
for i in $(PROJECT_PATH); do \
145
mkdir -p $$here/$(PACKAGE)-$(VERSION)/$$i; \
147
- $(MAKE) $(AM_MAKEFLAGS) copy COPY_DEST="$$here/$(PACKAGE)-$(VERSION)/$$i"; \
148
+ $(MAKE) $(AM_MAKEFLAGS) copy COPY_DEST="$$here/$(PACKAGE)-$(VERSION)/$$i" || exit $?; \
150
cp -L $(PYTHON_SOURCES) $(PYTHON_SOURCES2) $(DIST_SOURCES) $(DIST_COMMON) $(PACKAGE)-$(VERSION)
151
tar czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
152
rm -rf $(PACKAGE)-$(VERSION)