Skip to content

Commit 81ccfd3

Browse files
committed
Simplify and improve Debian packaging process
- Add script that packages jyut-dict. - Remove unneeded files.
1 parent bcb67ec commit 81ccfd3

File tree

31 files changed

+79
-171
lines changed

31 files changed

+79
-171
lines changed

src/jyut-dict/jyut-dict.pro

+17-12
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,23 @@ win32: {
110110
RC_ICONS = resources/icon/icon.ico
111111
}
112112

113-
#unix:!macx {
114-
# # Move files to appropriate locations on desktop to install the program
115-
# binfile.files += $$system_path($$OUT_PWD)/"Jyut Dictionary"
116-
# binfile.path = /opt/jyut-dict/
117-
# shortcutfiles.files += platform/linux/jyut-dict.desktop
118-
# shortcutfiles.path = /usr/share/applications/
119-
# icon.files += resources/icon/variant_3/icon.svg
120-
# icon.path = /opt/jyut-dict/
121-
# INSTALLS += binfile
122-
# INSTALLS += shortcutfiles
123-
# INSTALLS += icon
124-
#}
113+
unix:!macx {
114+
# Move files to appropriate locations on desktop to install the program
115+
binfile.extra = cp \"$$system_path($$OUT_PWD)/Jyut Dictionary\" $$system_path($$OUT_PWD)/jyut-dict
116+
binfile.files += $$system_path($$OUT_PWD)/jyut-dict
117+
binfile.path = /usr/bin/
118+
binfile.CONFIG += no_check_exist
119+
dictfile.files += resources/db/eng.db
120+
dictfile.path = /usr/share/jyut-dict/dictionaries/
121+
shortcutfiles.files += platform/linux/jyut-dict.desktop
122+
shortcutfiles.path = /usr/share/applications/
123+
icon.files += resources/icon/jyut-dict.svg
124+
icon.path = /usr/share/icons/hicolor/scalable/apps/
125+
INSTALLS += binfile
126+
INSTALLS += dictfile
127+
INSTALLS += shortcutfiles
128+
INSTALLS += icon
129+
}
125130

126131
unix|win32:!macx {
127132
# Copy dictionary database to the build directory

src/jyut-dict/logic/search/sqldatabasemanager.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ void SQLDatabaseManager::openEnglishDatabase()
3535
+ "/Dictionaries/eng.db"};
3636
#else
3737
QFileInfo bundleFile{QCoreApplication::applicationDirPath() + "/eng.db"};
38-
QFileInfo localFile{QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
39-
+ "/dictionaries/eng.db"};
38+
QFileInfo localFile{"/usr/share/jyut-dict/dictionaries/eng.db"};
4039
#endif
4140

4241
#ifdef PORTABLE
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
cd ../..
4+
5+
tar -cvzf ../jyut-dict_0.19.0614.tar.gz * --overwrite
6+
7+
cd ../
8+
9+
rm -rf jyut-dict_0.19.0614
10+
mkdir jyut-dict_0.19.0614
11+
12+
cd jyut-dict_0.19.0614
13+
14+
tar -xvzf ../jyut-dict_0.19.0614.tar.gz --overwrite
15+
16+
cp -r ../jyut-dict/platform/linux/debian ./debian
17+
18+
rm ./eng.db
19+
rm ./jyut-dict
20+
21+
dh_make -c mit -s -f ../jyut-dict_0.19.0614.tar.gz -p jyut-dict_0.19.0614
22+
23+
debuild

src/jyut-dict/platform/linux/debian/.debhelper/generated/jyutdict/installed-by-dh_installdocs

Whitespace-only changes.

src/jyut-dict/platform/linux/debian/.debhelper/jyutdict/dbgsym-root/DEBIAN/control

-13
This file was deleted.

src/jyut-dict/platform/linux/debian/.debhelper/jyutdict/dbgsym-root/DEBIAN/md5sums

-1
This file was deleted.

src/jyut-dict/platform/linux/debian/.debhelper/jyutdict/dbgsym-root/usr/share/doc/jyutdict-dbgsym

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
jyutdict (0.19.0614-1) unstable; urgency=medium
1+
jyut-dict (0.19.0614-1) bionic; urgency=medium
22

33
* Initial release
44

5-
-- Aaron Tan <[email protected]> Mon, 17 Jun 2019 00:48:23 -0400
5+
-- Aaron Tan <[email protected]> Fri, 14 Jun 2019 00:48:23 -0400

src/jyut-dict/platform/linux/debian/control

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Source: jyutdict
1+
Source: jyut-dict
22
Section: utils
33
Priority: optional
44
Maintainer: Aaron <[email protected]>
55
Build-Depends: debhelper (>= 10), libqt5core5a (>= 5.9.0), libqt5gui5 (>= 5.9.0), libqt5network5 (>= 5.9.0), libqt5widgets5 (>= 5.9.0)
66
Standards-Version: 4.1.2
77
Homepage: https://github.com/aaronhktan/jyut-dict
8-
#Vcs-Git: https://anonscm.debian.org/git/collab-maint/jyutdict.git
9-
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/jyutdict.git
8+
#Vcs-Git: https://anonscm.debian.org/git/collab-maint/jyut-dict.git
9+
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/jyut-dict.git
1010

11-
Package: jyutdict
11+
Package: jyut-dict
1212
Architecture: any
1313
Depends: ${shlibs:Depends}, ${misc:Depends}
1414
Description: Search words in Cantonese and Mandarin!

src/jyut-dict/platform/linux/debian/copyright

-9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ Files: *
66
Copyright: 2019 Aaron Tan <[email protected]>
77
License: MIT
88

9-
Files: debian/*
10-
Copyright: 2019 Aaron <[email protected]>
11-
License: MIT
12-
139
License: MIT
1410
Permission is hereby granted, free of charge, to any person obtaining a copy
1511
of this software and associated documentation files (the "Software"), to deal
@@ -28,8 +24,3 @@ License: MIT
2824
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2925
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3026
SOFTWARE.
31-
32-
# Please also look if there are files or directories which have a
33-
# different copyright/license attached and list them here.
34-
# Please avoid picking licenses with terms that are more restrictive than the
35-
# packaged work, as it may make Debian's contributions unacceptable upstream.
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jyutdict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
2-
jyutdict_0.19.0614-1_amd64.buildinfo utils optional
3-
jyutdict_0.19.0614-1_amd64.deb utils optional
1+
jyut-dict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
2+
jyut-dict_0.19.0614-1_amd64.buildinfo utils optional
3+
jyut-dict_0.19.0614-1_amd64.deb utils optional
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#
2-
# Regular cron jobs for the jyutdict package
2+
# Regular cron jobs for the jyut-dict package
33
#
4-
0 4 * * * root [ -x /usr/bin/jyutdict_maintenance ] && /usr/bin/jyutdict_maintenance
4+
0 4 * * * root [ -x /usr/bin/jyut-dict_maintenance ] && /usr/bin/jyut-dict_maintenance
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Document: jyutdict
2-
Title: Debian jyutdict Manual
1+
Document: jyut-dict
2+
Title: Debian jyut-dict Manual
33
Author: <insert document author here>
4-
Abstract: This manual describes what jyutdict is
4+
Abstract: This manual describes what jyut-dict is
55
and how it can be used to
66
manage online manuals on Debian systems.
77
Section: unknown
88

99
Format: debiandoc-sgml
10-
Files: /usr/share/doc/jyutdict/jyutdict.sgml.gz
10+
Files: /usr/share/doc/jyut-dict/jyut-dict.sgml.gz
1111

1212
Format: postscript
13-
Files: /usr/share/doc/jyutdict/jyutdict.ps.gz
13+
Files: /usr/share/doc/jyut-dict/jyut-dict.ps.gz
1414

1515
Format: text
16-
Files: /usr/share/doc/jyutdict/jyutdict.text.gz
16+
Files: /usr/share/doc/jyut-dict/jyut-dict.text.gz
1717

1818
Format: HTML
19-
Index: /usr/share/doc/jyutdict/html/index.html
20-
Files: /usr/share/doc/jyutdict/html/*.html
19+
Index: /usr/share/doc/jyut-dict/html/index.html
20+
Files: /usr/share/doc/jyut-dict/html/*.html

src/jyut-dict/platform/linux/debian/jyutdict/DEBIAN/control

-15
This file was deleted.

src/jyut-dict/platform/linux/debian/jyutdict/DEBIAN/md5sums

-7
This file was deleted.
Binary file not shown.
Binary file not shown.

src/jyut-dict/platform/linux/debian/jyutdict/usr/share/applications/jyut-dict.desktop

-12
This file was deleted.

src/jyut-dict/platform/linux/debian/jyutdict/usr/share/doc/jyutdict/README.Debian

-6
This file was deleted.

src/jyut-dict/platform/linux/debian/jyutdict/usr/share/doc/jyutdict/copyright

-34
This file was deleted.

src/jyut-dict/platform/linux/debian/manpage.xml.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
5656
<!ENTITY dhsection "SECTION">
5757
<!-- TITLE should be something like "User commands" or similar (see
5858
http://www.tldp.org/HOWTO/Man-Page/q2.html). -->
59-
<!ENTITY dhtitle "jyutdict User Manual">
60-
<!ENTITY dhucpackage "Jyutdict">
61-
<!ENTITY dhpackage "jyutdict">
59+
<!ENTITY dhtitle "jyut-dict User Manual">
60+
<!ENTITY dhucpackage "jyut-dict">
61+
<!ENTITY dhpackage "jyut-dict">
6262
]>
6363
6464
<refentry>
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
?package(jyutdict):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
2-
title="jyutdict" command="/usr/bin/jyutdict"
1+
?package(jyut-dict):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
2+
title="jyut-dict" command="/usr/bin/jyut-dict"

src/jyut-dict/platform/linux/debian/postinst.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# postinst script for jyutdict
2+
# postinst script for jyut-dict
33
#
44
# see: dh_installdeb(1)
55

src/jyut-dict/platform/linux/debian/postrm.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# postrm script for jyutdict
2+
# postrm script for jyut-dict
33
#
44
# see: dh_installdeb(1)
55

src/jyut-dict/platform/linux/debian/preinst.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# preinst script for jyutdict
2+
# preinst script for jyut-dict
33
#
44
# see: dh_installdeb(1)
55

src/jyut-dict/platform/linux/debian/prerm.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# prerm script for jyutdict
2+
# prerm script for jyut-dict
33
#
44
# see: dh_installdeb(1)
55

-21
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11
#!/usr/bin/make -f
2-
# See debhelper(7) (uncomment to enable)
3-
# output every command that modifies files on the build system.
4-
#export DH_VERBOSE = 1
5-
6-
7-
# see FEATURE AREAS in dpkg-buildflags(1)
8-
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
9-
10-
# see ENVIRONMENT in dpkg-buildflags(1)
11-
# package maintainers to append CFLAGS
12-
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
13-
# package maintainers to append LDFLAGS
14-
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
15-
162

173
%:
184
dh $@
195

206
override_dh_shlibdeps:
217
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
228

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

src/jyut-dict/platform/linux/debian/watch.ex

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ version=4
1111

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

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

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

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

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

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

3434

3535

3636

3737
# Uncomment to find new files on GooglePages
38-
# http://example.googlepages.com/foo.html jyutdict-(.*)\.tar\.gz
38+
# http://example.googlepages.com/foo.html jyut-dict-(.*)\.tar\.gz

src/jyut-dict/platform/linux/jyut-dict.desktop

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Type=Application
44
Name=Jyut Dictionary
55
GenericName=Cantonese Dictionary
66
Comment=Look up definitions for words in Cantonese or Mandarin
7-
Exec=/usr/opt/jyut-dict
7+
Exec=/usr/bin/jyut-dict
88
Terminal=false
9-
Icon=/usr/share/jyut-dict/icon.svg
9+
Icon=/usr/share/icons/hicolor/scalable/apps/jyut-dict.svg
1010
Keywords=Jyut;Dictionary;Cantonese;Mandarin;Chinese;Words;
11-
Categories=Dictionary;Office;TextTools;Education;Utilities
11+
Categories=Dictionary;Office;TextTools;Education;Utility
1212
StartupNotify=true

0 commit comments

Comments
 (0)