Skip to content

Commit 76e1459

Browse files
committed
make package: now builds RPM pkgs as well
1 parent f8d2640 commit 76e1459

6 files changed

+108
-14
lines changed

INSTALL-cmake.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,20 @@ The following command will generate `zip` and `tar.gz` source files:
213213
$ make package_source
214214

215215

216-
Creating Binary Packages
217-
------------------------
216+
Creating Debian Binary Packages
217+
-------------------------------
218218
This command generates `DEB` packages. It should work on any linux host but it
219219
will produce better deb packages when Debian specific tools ‘dpkg-xxx’ are
220220
usable on the build system.
221221

222222
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DWEBKIT1=ON <XIPHOS_SOURCE_DIR>
223223
$ make package
224+
225+
226+
Creating a Fedora Binary Package
227+
--------------------------------
228+
This command generates a `RPM` package and a standard `spec` file as well.
229+
230+
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DGTKHTML=ON <XIPHOS_SOURCE_DIR>
231+
$ make package
232+

cpack/CMakeLists.txt

+2-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ set(CPACK_MONOLITHIC_INSTALL "OFF")
9898
# List of CPack generators to use. If not specified, CPack will create a set of
9999
# options CPACK_BINARY_<GENNAME> (e.g., CPACK_BINARY_NSIS) allowing the user to
100100
# enable/disable individual generators.
101-
set(CPACK_GENERATOR "DEB")
101+
set(CPACK_GENERATOR "DEB;RPM")
102102

103103
# The name of the CPack binary configuration file. This file is the CPack
104104
# configuration generated by the CPack module for binary installers.
@@ -196,13 +196,10 @@ endif(UNIX)
196196

197197
# call generators
198198
if (UNIX)
199-
if (CPACK_GENERATOR MATCHES "RPM")
200199
# CPack RPM generator
201-
include(rpm/XiphosRpmPkg.cmake)
202-
elseif (CPACK_GENERATOR MATCHES "DEB")
200+
include(fedora/XiphosRPMPkg.cmake)
203201
# CPack Debian generator (Unix only)
204202
include(debian/XiphosDebianPkg.cmake)
205-
endif()
206203
endif (UNIX)
207204

208205
if(WIN32)

cpack/debian/XiphosDebianPkg.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ set(CPACK_DEBIAN_BINARIES_FILE_NAME "DEB-DEFAULT")
102102
set(CPACK_DEBIAN_BINARIES_PACKAGE_ARCHITECTURE ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
103103

104104
# rename package file name in the Debian style
105-
set(CPACK_PACKAGE_FILE_NAME "{CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
105+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
106106

107107
# May be set to ON in order to use dpkg-shlibdeps to generate package dependency
108108
# list. You may need set CMAKE_INSTALL_RPATH to an appropriate value if you use

cpack/fedora/XiphosRPMPkg.cmake

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Xiphos build script
2+
#
3+
# Copyright (C) 2018 Xiphos Development Team
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 2 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU Library General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, write to the Free Software
17+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18+
#
19+
20+
# Generate RPM
21+
22+
# configure the standard spec file
23+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/fedora/xiphos.spec.in" "${CMAKE_BINARY_DIR}/xiphos.spec" @ONLY IMMEDIATE)
24+
25+
# get current date
26+
set(CURRENT_DATE "Thu May 31 2018")
27+
if(UNIX)
28+
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${CURRENT_DATE})
29+
endif(UNIX)
30+
31+
# The RPM package summary
32+
set(CPACK_RPM_PACKAGE_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
33+
34+
# The RPM package name
35+
set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
36+
37+
# The RPM package version
38+
set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
39+
40+
# The RPM package architecture
41+
set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CPACK_PACKAGE_ARCHITECTURE}")
42+
43+
# The RPM package release
44+
set(CPACK_RPM_PACKAGE_RELEASE "1")
45+
46+
# The dist tag that is added RPM Release: field
47+
set(CPACK_RPM_PACKAGE_RELEASE_DIST "%{dist}")
48+
49+
# Package file name
50+
set(CPACK_RPM_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}${CPACK_RPM_PACKAGE_RELEASE_DIST}.${CPACK_PACKAGE_ARCHITECTURE}.rpm")
51+
52+
# The RPM package license policy
53+
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2+")
54+
55+
# The RPM package vendor
56+
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
57+
58+
# The projects URL
59+
set(CPACK_RPM_PACKAGE_URL "${XIPHOS_WEBSITE}")
60+
61+
# RPM package description
62+
set(CPACK_RPM_PACKAGE_DESCRIPTION
63+
"Xiphos is a Bible study tool written for Linux,
64+
UNIX, and Windows under the GNOME toolkit, offering a rich and featureful
65+
environment for reading, study, and research using modules from The SWORD
66+
Project and elsewhere.
67+
This build produced by Xiphos development; not from official Fedora repo.")
68+
69+
# RPM spec requires field
70+
set(CPACK_RPM_PACKAGE_REQUIRES
71+
"sword, biblesync, dbus-glib, libglade2, gtk3, webkitgtk4, gtkhtml3, yelp")
72+
73+
# RPM spec obsoletes field.
74+
set(CPACK_RPM_PACKAGE_OBSOLETES "xiphos-gtk2, xiphos-gtk3, xiphos-common")
75+
76+
# RPM changelog file
77+
# get ChangeLog date
78+
file(TIMESTAMP ${CMAKE_SOURCE_DIR}/ChangeLog
79+
XIPHOS_RPM_CHANGELOG_DATE "%a %b %d %Y" UTC)
80+
# configure ChangeLog file
81+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/fedora/xiphos.changelog.in" "${CMAKE_CURRENT_BINARY_DIR}/ChangeLog" @ONLY IMMEDIATE)
82+
# set RPM changelog file name
83+
set(CPACK_RPM_CHANGELOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/ChangeLog")

cpack/fedora/xiphos.changelog.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @XIPHOS_RPM_CHANGELOG_DATE@ The Xiphos Development Team <[email protected]> - @CPACK_RPM_PACKAGE_VERSION@-@CPACK_RPM_PACKAGE_RELEASE@@CPACK_RPM_PACKAGE_RELEASE_DIST@
2+
Generated by CPack RPM

cpack/fedora/xiphos.spec cpack/fedora/xiphos.spec.in

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
Name: xiphos
2-
Version: 4.1.0
1+
Name: @CPACK_PACKAGE_NAME@
2+
Version: @CPACK_PACKAGE_VERSION@
33
Release: 1%{?dist}
44
Summary: Bible study and research tool
55
License: GPLv2+
6-
URL: http://xiphos.org/
6+
URL: @XIPHOS_WEBSITE@
7+
Vendor: @CPACK_PACKAGE_VENDOR@
8+
79
Source0: https://github.com/crosswire/xiphos/releases/download/%{version}/xiphos-%{version}.tar.gz
10+
811
BuildRequires: biblesync-devel >= 2.0.1
912
BuildRequires: desktop-file-utils
1013
BuildRequires: dbus-glib-devel
@@ -21,10 +24,10 @@ BuildRequires: sword-devel >= 1.8.1
2124
BuildRequires: gtk3-devel
2225
BuildRequires: webkitgtk4-devel
2326
BuildRequires: gtkhtml3-devel
27+
BuildRequires: yelp-tools
2428
Requires: yelp
25-
# added (CMake port)
2629
BuildRequires: itstool
27-
BuildRequires: yelp-tools
30+
2831
#
2932
Provides: xiphos
3033
Provides: xiphos-common
@@ -40,7 +43,7 @@ ExcludeArch: ppc64
4043

4144
%description
4245
Xiphos is a Bible study tool written for Linux,
43-
NIX, and Windows under the GNOME toolkit, offering a rich and featureful
46+
UNIX, and Windows under the GNOME toolkit, offering a rich and featureful
4447
environment for reading, study, and research using modules from The SWORD
4548
Project and elsewhere.
4649
This build produced by Xiphos development; not from official Fedora repo.

0 commit comments

Comments
 (0)