File debian.rules of Package magic

#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

NAME    = magic
VERSION = 8.3.590
DESTDIR = $(CURDIR)/debian/tmp
DOCDIR  = $(DESTDIR)/usr/share/doc
_libdir = /usr/lib64

%:
	dh $@ --with python3

binary:
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_prep
	sed -i.cflags -e 's|CFLAGS=.*CFLAGS|:|' configure
	sed -i.nocpp \
	  scripts/configure.in scripts/configure \
	  -e 's|-lstdc++||'
	sed -i.arch scripts/defs.mak.in \
	  -e 's|^INSTALL_LIBDIR.*$$|INSTALL_LIBDIR\t=$(_libdir)|'
	sed -i "s|/usr/local/bin/tclsh|/usr/bin/tclsh|"  tcltk/strip_reflibs.tcl
	sed -i "s|package require -exact|package require|" tcltk/tkcon.tcl
	sed -i scripts/configure -e 's| -lfontconfig -lfreetype||'
	export WISH=/usr/bin/wish; \
	export   CFLAGS="-std=gnu99 -fPIE -Wno-error=implicit-function-declaration -Wno-error=implicit-int"; \
	export CXXFLAGS="-std=gnu99 -fPIE -Wno-error=implicit-function-declaration -Wno-error=implicit-int"; \
	./configure --prefix=/usr              \
	            --libdir=$(_libdir)        \
	            --with-tcl=/usr/lib/tcl8.6 \
	            --with-tk=/usr/lib/tk8.6   \
	            --with-tcllibs=$(_libdir)  \
	            --with-tklibs=$(_libdir);  \
	make DESTDIR=$(DESTDIR) -j1;         \
	if [ $$? -ne 0 ]; then exit 1; fi;   \
	make install \
	    DESTDIR=$(DESTDIR)               \
	    INSTALL="/usr/bin/install -c -p" \
	    CP="/bin/cp -p";                 \
	if [ $$? -ne 0 ]; then exit 1; fi;   \
	desktop-file-install \
	    --vendor ""      \
	    --dir $(DESTDIR)/usr/share/applications/ \
	    /usr/src/packages/SOURCES/magic.desktop; \
	mkdir -p $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/; \
	install -cpm 0644 /usr/src/packages/SOURCES/magic.png \
	    $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/magic.png; \
	rm -f $(DESTDIR)/usr/man/man1/extcheck.1*
	dh_installdeb
	dh_install
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

clean:
	dh_testdir
	dh_testroot
	dh_clean
openSUSE Build Service is sponsored by