root/trunk/digitalme/SpecBuild.cmake

Revision 2575, 6.4 kB (checked in by ahodgkinson, 11 months ago)

Minor updates to the spec file.

Line 
1#------------------------------------------------------------------------------
2# Desc: Script for building an RPM spec file
3# Tabs: 3
4#
5# Copyright (c) 2007-2009 Novell, Inc. All Rights Reserved.
6#
7# This program and the accompanying materials are made available
8# under, alternatively, the terms of:  a) the Eclipse Public License v1.0
9# which accompanies this distribution, and is available at
10# http://www.eclipse.org/legal/epl-v10.html; or, b) the Apache License,
11# Version 2.0 which accompanies this distribution and is available at
12# www.opensource.org/licenses/apache2.0.php.
13#
14# To contact Novell about this file by physical or electronic mail,
15# you may find current contact information at www.novell.com.
16#
17# Author: Andrew Hodgkinson <ahodgkinson@novell.com>
18#------------------------------------------------------------------------------
19
20# Sanity checks
21
22if( NOT SPEC_FILE)
23        message( FATAL_ERROR "SPEC_FILE variable has not been defined.")
24endif( NOT SPEC_FILE)
25
26if( NOT PACKAGE_VERSION)
27        message( FATAL_ERROR "PACKAGE_VERSION variable has not been defined.")
28endif( NOT PACKAGE_VERSION)
29
30if( NOT PRODUCT_INSTALL_PREFIX)
31        message( FATAL_ERROR "PRODUCT_INSTALL_PREFIX variable has not been defined.")
32endif( NOT PRODUCT_INSTALL_PREFIX)
33
34set( PROJECT_NAME "digitalme")
35
36# Remove the file if it already exists
37
38file( REMOVE ${SPEC_FILE})
39
40# Build and output the file
41
42file( APPEND ${SPEC_FILE}       "# spec file for package ${PROJECT_NAME} (Version ${PACKAGE_VERSION})\n")
43file( APPEND ${SPEC_FILE}       "#\n")
44file( APPEND ${SPEC_FILE}       "# Copyright (c) 2007-2009 Novell, Inc. All Rights Reserved.\n")
45file( APPEND ${SPEC_FILE}       "#\n")
46file( APPEND ${SPEC_FILE}       "# This program and the accompanying materials are made available\n")
47file( APPEND ${SPEC_FILE}       "# under, alternatively, the terms of:  a) the Eclipse Public License v1.0\n")
48file( APPEND ${SPEC_FILE}       "# which accompanies this distribution, and is available at\n")
49file( APPEND ${SPEC_FILE}       "# http://www.eclipse.org/legal/epl-v10.html; or, b) the Apache License,\n")
50file( APPEND ${SPEC_FILE}       "# Version 2.0 which accompanies this distribution and is available at\n")
51file( APPEND ${SPEC_FILE}       "# www.opensource.org/licenses/apache2.0.php.\n")
52file( APPEND ${SPEC_FILE}       "#\n")
53file( APPEND ${SPEC_FILE}       "# To contact Novell about this file by physical or electronic mail,\n")
54file( APPEND ${SPEC_FILE}       "# you may find current contact information at www.novell.com.\n")
55file( APPEND ${SPEC_FILE}       "\n")
56
57file( APPEND ${SPEC_FILE}       "Summary: DigitalMe\n")
58file( APPEND ${SPEC_FILE}       "Url: http://www.digitalme.com\n")
59file( APPEND ${SPEC_FILE}       "\n")
60
61file( APPEND ${SPEC_FILE}       "Name: ${PROJECT_NAME}\n")
62file( APPEND ${SPEC_FILE}       "Version: ${PACKAGE_VERSION}\n")
63file( APPEND ${SPEC_FILE}       "Release: 1.1\n")
64file( APPEND ${SPEC_FILE}       "License: Eclipse Public License, see http://www.eclipse.org/legal\n")
65file( APPEND ${SPEC_FILE}       "Group: Productivity/Security\n")
66file( APPEND ${SPEC_FILE}       "Source: %{name}-%{version}.tar.bz2\n")
67file( APPEND ${SPEC_FILE}       "BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build\n")
68file( APPEND ${SPEC_FILE}       "BuildRequires: cmake >= 2.4 gcc-c++ libglade2-devel >= 2.5 openssl-devel >= 0.9.7 gnome-keyring-devel >= 0.4 make >= 3.8 unzip zip tar binutils\n")
69file( APPEND ${SPEC_FILE}       "\n")
70
71file( APPEND ${SPEC_FILE}       "%description\n")
72file( APPEND ${SPEC_FILE}       "A Microsoft CardSpace compatible identity selector\n")
73file( APPEND ${SPEC_FILE}       "\n")
74
75file( APPEND ${SPEC_FILE}       "%if 0%{?suse_version}\n")
76file( APPEND ${SPEC_FILE}       "%define firefox MozillaFirefox\n")
77file( APPEND ${SPEC_FILE}       "%else\n")
78file( APPEND ${SPEC_FILE}       "%define firefox firefox\n")
79file( APPEND ${SPEC_FILE}       "%endif\n")
80file( APPEND ${SPEC_FILE}       "\n")
81
82file( APPEND ${SPEC_FILE}       "%package firefox\n")
83file( APPEND ${SPEC_FILE}       "License: Eclipse Public License, see http://www.eclipse.org/legal\n")
84file( APPEND ${SPEC_FILE}       "Summary: DigitalMe Firefox Add-on\n")
85file( APPEND ${SPEC_FILE}       "Group: Productivity/Security\n")
86file( APPEND ${SPEC_FILE}       "Requires: digitalme = %{version}\n")
87file( APPEND ${SPEC_FILE}       "Requires: %{firefox}\n")
88file( APPEND ${SPEC_FILE}       "\n")
89
90file( APPEND ${SPEC_FILE}       "%description firefox\n")
91file( APPEND ${SPEC_FILE}       "Firefox Add-on for DigitalMe, a Microsoft CardSpace compatible identity selector.\n")
92file( APPEND ${SPEC_FILE}       "\n")
93
94file( APPEND ${SPEC_FILE}       "%prep\n")
95file( APPEND ${SPEC_FILE}       "%setup -q\n")
96file( APPEND ${SPEC_FILE}       "\n")
97
98file( APPEND ${SPEC_FILE}       "%build\n")
99file( APPEND ${SPEC_FILE}       "./configure -DPROJECT_VERSION=%{version} -DPRODUCT_INSTALL_PREFIX=%{_prefix} -DPRODUCT_INSTALL_LIB_DIR=%{_libdir} -DPRODUCT_INSTALL_DATA_DIR=%{_datadir} -DDISABLE_SOURCE_INSTALL=YES\n")
100file( APPEND ${SPEC_FILE}       "make\n")
101file( APPEND ${SPEC_FILE}       "pushd launchers/firefox-addon\n")
102file( APPEND ${SPEC_FILE}       "bash ./configure -DPROJECT_VERSION=%{version} -DPRODUCT_INSTALL_PREFIX=%{_prefix} -DPRODUCT_INSTALL_LIB_DIR=%{_libdir} -DPRODUCT_INSTALL_DATA_DIR=%{_datadir} -DDISABLE_SOURCE_INSTALL=YES\n")
103file( APPEND ${SPEC_FILE}       "make xpi-jar\n")
104file( APPEND ${SPEC_FILE}       "popd\n")
105file( APPEND ${SPEC_FILE}       "\n")
106
107file( APPEND ${SPEC_FILE}       "%install\n")
108file( APPEND ${SPEC_FILE}       "make install DESTDIR=%{buildroot}\n")
109file( APPEND ${SPEC_FILE}       "mkdir -p %{buildroot}%{_libdir}/firefox/extensions\n")
110file( APPEND ${SPEC_FILE}       "cp -a launchers/firefox-addon/build/package-stage %{buildroot}%{_libdir}/firefox/extensions/{b65efa6d-ca84-4226-bde7-8feee2f62519}\n")
111file( APPEND ${SPEC_FILE}       "\n")
112
113file( APPEND ${SPEC_FILE}       "%files -f install_manifest.txt\n")
114file( APPEND ${SPEC_FILE}       "%defattr\(-,root,root\)\n")
115file( APPEND ${SPEC_FILE}       "%doc AUTHORS COPYING COPYRIGHT\n")
116file( APPEND ${SPEC_FILE}       "%dir %{_libdir}/%{name}\n")
117file( APPEND ${SPEC_FILE}       "%dir %{_datadir}/%{name}\n")
118file( APPEND ${SPEC_FILE}       "%dir %{_datadir}/%{name}/certs\n")
119file( APPEND ${SPEC_FILE}       "\n")
120
121file( APPEND ${SPEC_FILE}       "%files firefox\n")
122file( APPEND ${SPEC_FILE}       "%defattr(-,root,root,-)\n")
123file( APPEND ${SPEC_FILE}       "%dir %{_libdir}/firefox\n")
124file( APPEND ${SPEC_FILE}       "%dir %{_libdir}/firefox/extensions\n")
125file( APPEND ${SPEC_FILE}       "%{_libdir}/firefox/extensions/{b65efa6d-ca84-4226-bde7-8feee2f62519}\n")
126file( APPEND ${SPEC_FILE}       "\n")
127
128file( APPEND ${SPEC_FILE}       "%changelog\n")
129file( READ ChangeLog CHANGE_LOG_TEXT)
130file( APPEND ${SPEC_FILE}       ${CHANGE_LOG_TEXT})
Note: See TracBrowser for help on using the browser.