From d339c145870a86c37509debe5d8fa145e192f390 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Fri, 9 Feb 2024 21:09:54 -0500 Subject: ffs: major refresh on top of bastif dpkg --- freefilesync/debian/rules | 116 ++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 82 deletions(-) (limited to 'freefilesync/debian/rules') diff --git a/freefilesync/debian/rules b/freefilesync/debian/rules index 8476609..2654668 100755 --- a/freefilesync/debian/rules +++ b/freefilesync/debian/rules @@ -1,102 +1,54 @@ #!/usr/bin/make -f # You must remove unused comment lines for the released package. #export DH_VERBOSE = 1 -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -export linkFlags="${LDFLAGS} -pie" -export appname=freefilesync -export pkgname=FreeFileSync -export prog2name=RealTimeSync -export debuilddir="debian" -export debuildappdir="${pkgname}" -export buildroot="${debuilddir}/${appname}" -export _datadir="/usr/share" -export _bindir="/usr/bin" +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk -export TMPDIR=/tmp +include /usr/share/dpkg/architecture.mk + +include /usr/share/dpkg/buildtools.mk + +# Produce .debug_info (used by dh_dwz) +CXXFLAGS += -g + +# Enable PIE +#CXXFLAGS += -fpie +#LDFLAGS += -pie + +#stackrpms,2: I put APP_NAME_SUFFIX in Makefile +# libatomic stuff is for ubuntu only %: - dh $@ + dh $@ --sourcedirectory=FreeFileSync/Source -override_dh_auto_clean: - dh_auto_clean - dh_auto_clean --sourcedirectory=FreeFileSync/Source +execute_after_dh_auto_clean: + # Now, auto_clean RealTimeSync dh_auto_clean --sourcedirectory=FreeFileSync/Source/RealTimeSync - rm -f ${pkgname}.png ${prog2name}.png cfg_batch.png -override_dh_auto_build: - dh_auto_build - dh_auto_build --sourcedirectory=FreeFileSync/Source +execute_after_dh_auto_build: + # Now, auto_build RealTimeSync dh_auto_build --sourcedirectory=FreeFileSync/Source/RealTimeSync override_dh_auto_install: - # removed by upstream! - #dh_auto_install - #dh_auto_install --sourcedirectory=FreeFileSync/Source - #dh_auto_install --sourcedirectory=FreeFileSync/Source/RealTimeSync - install -d ${buildroot}${_bindir} ${buildroot}${_datadir}/${appname} - install -Dm 0755 -t ${buildroot}${_bindir} ${debuildappdir}/Build/Bin/${pkgname} ${debuildappdir}/Build/Bin/${prog2name} - cp -pr ${debuildappdir}/Build/Resources/* ${buildroot}${_datadir}/${appname} - - # make extra sure the files are not marked with executable - find ${debuildappdir}/share/${pkgname} -type f -exec chmod -x '{}' \; || : - # desktop files - # handled by dpkg already - - # application start script - # none - - # man pages - # none + # handled by dh_install through debian/install # mimetypes - # handled by dpkg already + # handled by dh_installmime through debian/sharedmimeinfo # icons - unzip ${pkgname}/Build/Resources/Icons.zip cfg_batch.png start_sync.png ${pkgname}.png ${prog2name}.png - mkdir -p ${buildroot}${_datadir}/icons/hicolor/16x16/apps - mkdir -p ${buildroot}${_datadir}/icons/hicolor/32x32/apps - mkdir -p ${buildroot}${_datadir}/icons/hicolor/48x48/apps - mkdir -p ${buildroot}${_datadir}/icons/hicolor/64x64/apps - mkdir -p ${buildroot}${_datadir}/icons/hicolor/128x128/apps - mkdir -p ${buildroot}${_datadir}/icons/hicolor/16x16/mimetypes - mkdir -p ${buildroot}${_datadir}/icons/hicolor/32x32/mimetypes - mkdir -p ${buildroot}${_datadir}/icons/hicolor/48x48/mimetypes - mkdir -p ${buildroot}${_datadir}/icons/hicolor/64x64/mimetypes - mkdir -p ${buildroot}${_datadir}/icons/hicolor/128x128/mimetypes - # apps - convert ${pkgname}.png -filter Lanczos -resize 16x16 ${buildroot}${_datadir}/icons/hicolor/16x16/apps/${pkgname}.png - convert ${pkgname}.png -filter Lanczos -resize 32x32 ${buildroot}${_datadir}/icons/hicolor/32x32/apps/${pkgname}.png - convert ${pkgname}.png -filter Lanczos -resize 48x48 ${buildroot}${_datadir}/icons/hicolor/48x48/apps/${pkgname}.png - convert ${pkgname}.png -filter Lanczos -resize 64x64 ${buildroot}${_datadir}/icons/hicolor/64x64/apps/${pkgname}.png - convert ${pkgname}.png -filter Lanczos -resize 128x128 ${buildroot}${_datadir}/icons/hicolor/128x128/apps/${pkgname}.png - convert ${prog2name}.png -filter Lanczos -resize 16x16 ${buildroot}${_datadir}/icons/hicolor/16x16/apps/${prog2name}.png - convert ${prog2name}.png -filter Lanczos -resize 32x32 ${buildroot}${_datadir}/icons/hicolor/32x32/apps/${prog2name}.png - convert ${prog2name}.png -filter Lanczos -resize 48x48 ${buildroot}${_datadir}/icons/hicolor/48x48/apps/${prog2name}.png - convert ${prog2name}.png -filter Lanczos -resize 64x64 ${buildroot}${_datadir}/icons/hicolor/64x64/apps/${prog2name}.png - convert ${prog2name}.png -filter Lanczos -resize 128x128 ${buildroot}${_datadir}/icons/hicolor/128x128/apps/${prog2name}.png - # mimetypes - convert cfg_batch.png -filter Lanczos -resize 16x16 ${buildroot}${_datadir}/icons/hicolor/16x16/mimetypes/application-x-freefilesync-batch.png - convert cfg_batch.png -filter Lanczos -resize 32x32 ${buildroot}${_datadir}/icons/hicolor/32x32/mimetypes/application-x-freefilesync-batch.png - convert cfg_batch.png -filter Lanczos -resize 48x48 ${buildroot}${_datadir}/icons/hicolor/48x48/mimetypes/application-x-freefilesync-batch.png - convert cfg_batch.png -filter Lanczos -resize 64x64 ${buildroot}${_datadir}/icons/hicolor/64x64/mimetypes/application-x-freefilesync-batch.png - convert cfg_batch.png -filter Lanczos -resize 128x128 ${buildroot}${_datadir}/icons/hicolor/128x128/mimetypes/application-x-freefilesync-batch.png - convert start_sync.png -filter Lanczos -resize 16x16 ${buildroot}${_datadir}/icons/hicolor/16x16/mimetypes/application-x-freefilesync-ffs.png - convert start_sync.png -filter Lanczos -resize 32x32 ${buildroot}${_datadir}/icons/hicolor/32x32/mimetypes/application-x-freefilesync-ffs.png - convert start_sync.png -filter Lanczos -resize 48x48 ${buildroot}${_datadir}/icons/hicolor/48x48/mimetypes/application-x-freefilesync-ffs.png - convert start_sync.png -filter Lanczos -resize 64x64 ${buildroot}${_datadir}/icons/hicolor/64x64/mimetypes/application-x-freefilesync-ffs.png - convert start_sync.png -filter Lanczos -resize 128x128 ${buildroot}${_datadir}/icons/hicolor/128x128/mimetypes/application-x-freefilesync-ffs.png - convert ${prog2name}.png -filter Lanczos -resize 16x16 ${buildroot}${_datadir}/icons/hicolor/16x16/mimetypes/application-x-freefilesync-real.png - convert ${prog2name}.png -filter Lanczos -resize 32x32 ${buildroot}${_datadir}/icons/hicolor/32x32/mimetypes/application-x-freefilesync-real.png - convert ${prog2name}.png -filter Lanczos -resize 48x48 ${buildroot}${_datadir}/icons/hicolor/48x48/mimetypes/application-x-freefilesync-real.png - convert ${prog2name}.png -filter Lanczos -resize 64x64 ${buildroot}${_datadir}/icons/hicolor/64x64/mimetypes/application-x-freefilesync-real.png - convert ${prog2name}.png -filter Lanczos -resize 128x128 ${buildroot}${_datadir}/icons/hicolor/128x128/mimetypes/application-x-freefilesync-real.png - - rm -f cfg_batch.png start_sync.png - -override_dh_fixperms: - dh_fixperms || : - chmod 0644 ${buildroot}${_datadir}/${appname}/* || : + unzip -u FreeFileSync/Build/Resources/Icons.zip cfg_batch.png database.png start_sync.png FreeFileSync.png RealTimeSync.png + for size in 16 24 32 48 64 128 256; do \ + mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps ; \ + convert FreeFileSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/FreeFileSync.png ; \ + convert RealTimeSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/RealTimeSync.png ; \ + mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes ; \ + convert cfg_batch.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-batch.png ; \ + convert database.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-db.png ; \ + convert start_sync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-gui.png ; \ + convert RealTimeSync.png -filter Lanczos -resize $${size}x$${size} debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/mimetypes/application-x-freefilesync-real.png ; \ + done -- cgit