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