Skip to content

Commit

Permalink
Simplify and improve Debian packaging process
Browse files Browse the repository at this point in the history
- Add script that packages jyut-dict.
- Remove unneeded files.
  • Loading branch information
aaronhktan committed Jun 19, 2019
1 parent bcb67ec commit 81ccfd3
Show file tree
Hide file tree
Showing 31 changed files with 79 additions and 171 deletions.
29 changes: 17 additions & 12 deletions src/jyut-dict/jyut-dict.pro
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,23 @@ win32: {
RC_ICONS = resources/icon/icon.ico
}

#unix:!macx {
# # Move files to appropriate locations on desktop to install the program
# binfile.files += $$system_path($$OUT_PWD)/"Jyut Dictionary"
# binfile.path = /opt/jyut-dict/
# shortcutfiles.files += platform/linux/jyut-dict.desktop
# shortcutfiles.path = /usr/share/applications/
# icon.files += resources/icon/variant_3/icon.svg
# icon.path = /opt/jyut-dict/
# INSTALLS += binfile
# INSTALLS += shortcutfiles
# INSTALLS += icon
#}
unix:!macx {
# Move files to appropriate locations on desktop to install the program
binfile.extra = cp \"$$system_path($$OUT_PWD)/Jyut Dictionary\" $$system_path($$OUT_PWD)/jyut-dict
binfile.files += $$system_path($$OUT_PWD)/jyut-dict
binfile.path = /usr/bin/
binfile.CONFIG += no_check_exist
dictfile.files += resources/db/eng.db
dictfile.path = /usr/share/jyut-dict/dictionaries/
shortcutfiles.files += platform/linux/jyut-dict.desktop
shortcutfiles.path = /usr/share/applications/
icon.files += resources/icon/jyut-dict.svg
icon.path = /usr/share/icons/hicolor/scalable/apps/
INSTALLS += binfile
INSTALLS += dictfile
INSTALLS += shortcutfiles
INSTALLS += icon
}

unix|win32:!macx {
# Copy dictionary database to the build directory
Expand Down
3 changes: 1 addition & 2 deletions src/jyut-dict/logic/search/sqldatabasemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ void SQLDatabaseManager::openEnglishDatabase()
+ "/Dictionaries/eng.db"};
#else
QFileInfo bundleFile{QCoreApplication::applicationDirPath() + "/eng.db"};
QFileInfo localFile{QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
+ "/dictionaries/eng.db"};
QFileInfo localFile{"/usr/share/jyut-dict/dictionaries/eng.db"};
#endif

#ifdef PORTABLE
Expand Down
23 changes: 23 additions & 0 deletions src/jyut-dict/platform/linux/create-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

cd ../..

tar -cvzf ../jyut-dict_0.19.0614.tar.gz * --overwrite

cd ../

rm -rf jyut-dict_0.19.0614
mkdir jyut-dict_0.19.0614

cd jyut-dict_0.19.0614

tar -xvzf ../jyut-dict_0.19.0614.tar.gz --overwrite

cp -r ../jyut-dict/platform/linux/debian ./debian

rm ./eng.db
rm ./jyut-dict

dh_make -c mit -s -f ../jyut-dict_0.19.0614.tar.gz -p jyut-dict_0.19.0614

debuild
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/jyut-dict/platform/linux/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jyutdict (0.19.0614-1) unstable; urgency=medium
jyut-dict (0.19.0614-1) bionic; urgency=medium

* Initial release

-- Aaron Tan <hi@aaronhktan.com> Mon, 17 Jun 2019 00:48:23 -0400
-- Aaron Tan <hi@aaronhktan.com> Fri, 14 Jun 2019 00:48:23 -0400
8 changes: 4 additions & 4 deletions src/jyut-dict/platform/linux/debian/control
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Source: jyutdict
Source: jyut-dict
Section: utils
Priority: optional
Maintainer: Aaron <hi@aaronhktan.com>
Build-Depends: debhelper (>= 10), libqt5core5a (>= 5.9.0), libqt5gui5 (>= 5.9.0), libqt5network5 (>= 5.9.0), libqt5widgets5 (>= 5.9.0)
Standards-Version: 4.1.2
Homepage: https://github.com/aaronhktan/jyut-dict
#Vcs-Git: https://anonscm.debian.org/git/collab-maint/jyutdict.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/jyutdict.git
#Vcs-Git: https://anonscm.debian.org/git/collab-maint/jyut-dict.git
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/jyut-dict.git

Package: jyutdict
Package: jyut-dict
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Search words in Cantonese and Mandarin!
Expand Down
9 changes: 0 additions & 9 deletions src/jyut-dict/platform/linux/debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Files: *
Copyright: 2019 Aaron Tan <hi@aaronhktan.com>
License: MIT

Files: debian/*
Copyright: 2019 Aaron <hi@aaronhktan.com>
License: MIT

License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -28,8 +24,3 @@ License: MIT
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.

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
6 changes: 3 additions & 3 deletions src/jyut-dict/platform/linux/debian/files
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jyutdict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
jyutdict_0.19.0614-1_amd64.buildinfo utils optional
jyutdict_0.19.0614-1_amd64.deb utils optional
jyut-dict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
jyut-dict_0.19.0614-1_amd64.buildinfo utils optional
jyut-dict_0.19.0614-1_amd64.deb utils optional
4 changes: 2 additions & 2 deletions src/jyut-dict/platform/linux/debian/jyutdict.cron.d.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
# Regular cron jobs for the jyutdict package
# Regular cron jobs for the jyut-dict package
#
0 4 * * * root [ -x /usr/bin/jyutdict_maintenance ] && /usr/bin/jyutdict_maintenance
0 4 * * * root [ -x /usr/bin/jyut-dict_maintenance ] && /usr/bin/jyut-dict_maintenance
16 changes: 8 additions & 8 deletions src/jyut-dict/platform/linux/debian/jyutdict.doc-base.EX
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Document: jyutdict
Title: Debian jyutdict Manual
Document: jyut-dict
Title: Debian jyut-dict Manual
Author: <insert document author here>
Abstract: This manual describes what jyutdict is
Abstract: This manual describes what jyut-dict is
and how it can be used to
manage online manuals on Debian systems.
Section: unknown

Format: debiandoc-sgml
Files: /usr/share/doc/jyutdict/jyutdict.sgml.gz
Files: /usr/share/doc/jyut-dict/jyut-dict.sgml.gz

Format: postscript
Files: /usr/share/doc/jyutdict/jyutdict.ps.gz
Files: /usr/share/doc/jyut-dict/jyut-dict.ps.gz

Format: text
Files: /usr/share/doc/jyutdict/jyutdict.text.gz
Files: /usr/share/doc/jyut-dict/jyut-dict.text.gz

Format: HTML
Index: /usr/share/doc/jyutdict/html/index.html
Files: /usr/share/doc/jyutdict/html/*.html
Index: /usr/share/doc/jyut-dict/html/index.html
Files: /usr/share/doc/jyut-dict/html/*.html
15 changes: 0 additions & 15 deletions src/jyut-dict/platform/linux/debian/jyutdict/DEBIAN/control

This file was deleted.

7 changes: 0 additions & 7 deletions src/jyut-dict/platform/linux/debian/jyutdict/DEBIAN/md5sums

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

6 changes: 3 additions & 3 deletions src/jyut-dict/platform/linux/debian/manpage.xml.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
<!ENTITY dhsection "SECTION">
<!-- TITLE should be something like "User commands" or similar (see
http://www.tldp.org/HOWTO/Man-Page/q2.html). -->
<!ENTITY dhtitle "jyutdict User Manual">
<!ENTITY dhucpackage "Jyutdict">
<!ENTITY dhpackage "jyutdict">
<!ENTITY dhtitle "jyut-dict User Manual">
<!ENTITY dhucpackage "jyut-dict">
<!ENTITY dhpackage "jyut-dict">
]>
<refentry>
Expand Down
4 changes: 2 additions & 2 deletions src/jyut-dict/platform/linux/debian/menu.ex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
?package(jyutdict):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
title="jyutdict" command="/usr/bin/jyutdict"
?package(jyut-dict):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
title="jyut-dict" command="/usr/bin/jyut-dict"
2 changes: 1 addition & 1 deletion src/jyut-dict/platform/linux/debian/postinst.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# postinst script for jyutdict
# postinst script for jyut-dict
#
# see: dh_installdeb(1)

Expand Down
2 changes: 1 addition & 1 deletion src/jyut-dict/platform/linux/debian/postrm.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# postrm script for jyutdict
# postrm script for jyut-dict
#
# see: dh_installdeb(1)

Expand Down
2 changes: 1 addition & 1 deletion src/jyut-dict/platform/linux/debian/preinst.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# preinst script for jyutdict
# preinst script for jyut-dict
#
# see: dh_installdeb(1)

Expand Down
2 changes: 1 addition & 1 deletion src/jyut-dict/platform/linux/debian/prerm.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# prerm script for jyutdict
# prerm script for jyut-dict
#
# see: dh_installdeb(1)

Expand Down
21 changes: 0 additions & 21 deletions src/jyut-dict/platform/linux/debian/rules
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
dh $@

override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info



# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

14 changes: 7 additions & 7 deletions src/jyut-dict/platform/linux/debian/watch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ version=4

# HTTP site (basic)
#http://example.com/downloads.html \
# files/jyutdict-([\d\.]+)\.tar\.gz debian uupdate
# files/jyut-dict-([\d\.]+)\.tar\.gz debian uupdate

# Uncomment to examine an FTP server
#ftp://ftp.example.com/pub/jyutdict-(.*)\.tar\.gz debian uupdate
#ftp://ftp.example.com/pub/jyut-dict-(.*)\.tar\.gz debian uupdate

# SourceForge hosted projects
# http://sf.net/jyutdict/ jyutdict-(.*)\.tar\.gz debian uupdate
# http://sf.net/jyut-dict/ jyut-dict-(.*)\.tar\.gz debian uupdate

# GitHub hosted projects
#opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%<project>-$1.tar.gz%" \
# https://github.com/<user>/jyutdict/tags \
# https://github.com/<user>/jyut-dict/tags \
# (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate

# PyPI
# https://pypi.debian.net/jyutdict/jyutdict-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
# https://pypi.debian.net/jyut-dict/jyut-dict-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))

# Direct Git
# opts="mode=git" http://git.example.com/jyutdict.git \
# opts="mode=git" http://git.example.com/jyut-dict.git \
# refs/tags/v([\d\.]+) debian uupdate




# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html jyutdict-(.*)\.tar\.gz
# http://example.googlepages.com/foo.html jyut-dict-(.*)\.tar\.gz
6 changes: 3 additions & 3 deletions src/jyut-dict/platform/linux/jyut-dict.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Type=Application
Name=Jyut Dictionary
GenericName=Cantonese Dictionary
Comment=Look up definitions for words in Cantonese or Mandarin
Exec=/usr/opt/jyut-dict
Exec=/usr/bin/jyut-dict
Terminal=false
Icon=/usr/share/jyut-dict/icon.svg
Icon=/usr/share/icons/hicolor/scalable/apps/jyut-dict.svg
Keywords=Jyut;Dictionary;Cantonese;Mandarin;Chinese;Words;
Categories=Dictionary;Office;TextTools;Education;Utilities
Categories=Dictionary;Office;TextTools;Education;Utility
StartupNotify=true
File renamed without changes

0 comments on commit 81ccfd3

Please sign in to comment.