nut/debian/rules

94 lines
3.4 KiB
Text
Raw Normal View History

2010-02-24 21:58:53 +00:00
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
2011-06-03 11:54:46 +00:00
include /usr/share/cdbs/1/class/python-module.mk
2010-02-24 21:58:53 +00:00
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
2011-06-03 09:54:05 +00:00
# List any files which are not installed
include /usr/share/cdbs/1/rules/utils.mk
common-binary-post-install-arch:: list-missing
2010-02-24 21:58:53 +00:00
DEB_CONFIGURE_PREFIX :=
DEB_CONFIGURE_SYSCONFDIR := /etc/nut
DEB_CONFIGURE_INCLUDEDIR := /usr/include
DEB_CONFIGURE_MANDIR := /usr/share/man
2012-08-12 20:18:54 +00:00
DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
--without-ssl \
--with-cgi \
--with-dev \
--enable-static \
--with-statepath=/var/run/nut \
--with-altpidpath=/var/run/nut \
--with-drvpath=/lib/nut \
--with-cgipath=/usr/lib/cgi-bin/nut \
--with-htmlpath=/usr/share/nut/www \
--with-pidpath=/var/run/nut \
--datadir=/usr/share/nut \
2012-08-12 20:18:54 +00:00
--with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
--with-user=nut --with-group=nut
2010-02-24 21:58:53 +00:00
ifeq (linux,$(DEB_HOST_ARCH_OS))
DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev
endif
2010-02-24 21:58:53 +00:00
# only build documentation if asciidoc is installed
ifneq ($(shell which asciidoc),)
DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf
endif
common-install-arch::
2010-02-24 21:58:53 +00:00
# install the bash completion script
mkdir -p $(CURDIR)/debian/tmp/etc/bash_completion.d
cp $(CURDIR)/scripts/misc/nut.bash_completion \
$(CURDIR)/debian/tmp/etc/bash_completion.d/nut
2011-12-02 19:40:30 +00:00
# install the avahi service file
mkdir -p $(CURDIR)/debian/tmp/etc/avahi/services
cp $(CURDIR)/scripts/avahi/nut.service \
$(CURDIR)/debian/tmp/etc/avahi/services
2011-12-02 20:02:54 +00:00
# install Augeas lenses
mkdir -p $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests
cp $(CURDIR)/scripts/augeas/*.aug \
$(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/
cp $(CURDIR)/scripts/augeas/tests/test_nut.aug \
$(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests/
2010-02-24 21:58:53 +00:00
# install the default configuration
for f in $(CURDIR)/debian/tmp/etc/nut/*; do \
nf=`basename $${f} | sed 's/\(.*\).sample/\1/'`; \
mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf}; \
done
2012-08-12 20:18:54 +00:00
# Create -dev symlink under /usr
ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.1.1.0 \
$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so
common-install-indep::
#install documentation
mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf
mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html
cp $(CURDIR)/docs/*.pdf $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf
cp $(CURDIR)/docs/FAQ.html $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html
for f in $(CURDIR)/docs/*.chunked/; do \
nf=`basename $${f} | sed 's/\(.*\)\.chunked/\1/'`; \
cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \
done
2011-06-03 14:22:58 +00:00
binary-install/nut-monitor::
dh_python2 -pnut-monitor
DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server -- start 50 2 3 4 5 . stop 51 0 1 6 .
DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client -- start 51 2 3 4 5 . stop 50 0 1 6 .
DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf
2010-02-24 21:58:53 +00:00
ifeq (linux,$(DEB_HOST_ARCH_OS))
# for Debian
DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 0.124-1)"
2010-02-24 21:58:53 +00:00
# for Ubuntu
# DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)"
2010-02-24 21:58:53 +00:00
endif