#!/usr/bin/make -f # # Copyright (C) 2004,2005,2006 Lemur Consulting Ltd # Copyright (C) 2006-2021 Olly Betts # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # Codename we're building packages for. For backported packages, put the # codename (e.g. jessie or trusty) in debian/codename. If that file doesn't # exist, the default is sid. # # (Currently nothing in this file varies depending on the codename). # CODENAME := $(shell cat debian/codename 2>/dev/null||echo sid) # Version without the "-N" suffix. XAPIAN_VERSION := $(shell sed 's/.*(\([^-]*\)\(-.*\)*).*/\1/;q' debian/changelog) # The next incompatible version - i.e. the first release of the next release # branch. So for XAPIAN_VERSION "1.0.", this should be "1.1.0". XAPIAN_VERSION_CEILING := $(shell echo '$(XAPIAN_VERSION)'|awk -F. '{print $$1"."$$2+1".0"}') # We need a versioned build dependency on libxapian-dev. # NB Trailing ',' required here! BUILD_DEPS := \ libxapian-dev (>= $(XAPIAN_VERSION)), \ libxapian-dev (<< $(XAPIAN_VERSION_CEILING)), export DEB_BUILD_MAINT_OPTIONS:=hardening=+all maint: debian/control : # Dummy action so the "%" target isn't used. maintclean: clean rm -f debian/control debian/control: debian/rules debian/control.in rm -f debian/control.tmp sed -e "s/@BUILD_DEPS@/$(BUILD_DEPS)/g" \ < debian/control.in > debian/control.tmp mv debian/control.tmp debian/control %: dh $@ --builddir=debian/build override_dh_auto_configure: debian/control dh_auto_configure -- --libdir=/usr/lib override_dh_auto_install: # Install the files into debian/tmp. dh_auto_install --destdir=debian/tmp # Replace omega.conf with one with paths suitable for debian. rm -f debian/tmp/etc/omega.conf install -m 644 debian/omega.conf.debian debian/tmp/etc/omega.conf # Install the icons. install -d -m 755 debian/tmp/usr/share/images/xapian-omega install -m 644 images/*.png debian/tmp/usr/share/images/xapian-omega # Install the omegascript templates. install -d -m 755 debian/tmp/usr/share/xapian-omega/templates install -d -m 755 debian/tmp/usr/share/xapian-omega/templates/inc install -m 644 templates/inc/[a-z]* debian/tmp/usr/share/xapian-omega/templates/inc install -m 644 templates/[a-hj-z]* debian/tmp/usr/share/xapian-omega/templates # Fix paths in query template, and install that instead. sed 's!/icons/omega/!/images/xapian-omega/!g' templates/query > debian/query.tmp install -m 644 debian/query.tmp debian/tmp/usr/share/xapian-omega/templates/query rm -f debian/query.tmp # Symlink them in as examples (they can't just go under /usr/share/doc # because policy 12.3 says "Packages must not require the existence of # any files in `/usr/share/doc/' in order to function"). install -d -m 755 debian/tmp/usr/share/doc/xapian-omega/examples ln -s ../../../xapian-omega/templates debian/tmp/usr/share/doc/xapian-omega/examples/templates # Create the /var directories. install -d -m 755 debian/tmp/var/lib/xapian-omega/data install -d -m 755 debian/tmp/var/lib/xapian-omega/cdb install -d -m 755 debian/tmp/var/log/xapian-omega override_dh_missing: # Compat level 13 defaults to --fail-missing, so this override can be # dropped once we upgrade to that. dh_missing --fail-missing