|
| 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") |
0 commit comments