#------------------------------------------------------------------------------ # Desc: Script for building an RPM spec file # Tabs: 3 # # Copyright (c) 2007-2009 Novell, Inc. All Rights Reserved. # # This program and the accompanying materials are made available # under, alternatively, the terms of: a) the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html; or, b) the Apache License, # Version 2.0 which accompanies this distribution and is available at # www.opensource.org/licenses/apache2.0.php. # # To contact Novell about this file by physical or electronic mail, # you may find current contact information at www.novell.com. # # Author: Andrew Hodgkinson #------------------------------------------------------------------------------ # Sanity checks if( NOT SPEC_FILE) message( FATAL_ERROR "SPEC_FILE variable has not been defined.") endif( NOT SPEC_FILE) if( NOT PACKAGE_VERSION) message( FATAL_ERROR "PACKAGE_VERSION variable has not been defined.") endif( NOT PACKAGE_VERSION) if( NOT PRODUCT_INSTALL_PREFIX) message( FATAL_ERROR "PRODUCT_INSTALL_PREFIX variable has not been defined.") endif( NOT PRODUCT_INSTALL_PREFIX) set( PROJECT_NAME "digitalme") # Remove the file if it already exists file( REMOVE ${SPEC_FILE}) # Build and output the file file( APPEND ${SPEC_FILE} "# spec file for package ${PROJECT_NAME} (Version ${PACKAGE_VERSION})\n") file( APPEND ${SPEC_FILE} "#\n") file( APPEND ${SPEC_FILE} "# Copyright (c) 2007-2009 Novell, Inc. All Rights Reserved.\n") file( APPEND ${SPEC_FILE} "#\n") file( APPEND ${SPEC_FILE} "# This program and the accompanying materials are made available\n") file( APPEND ${SPEC_FILE} "# under, alternatively, the terms of: a) the Eclipse Public License v1.0\n") file( APPEND ${SPEC_FILE} "# which accompanies this distribution, and is available at\n") file( APPEND ${SPEC_FILE} "# http://www.eclipse.org/legal/epl-v10.html; or, b) the Apache License,\n") file( APPEND ${SPEC_FILE} "# Version 2.0 which accompanies this distribution and is available at\n") file( APPEND ${SPEC_FILE} "# www.opensource.org/licenses/apache2.0.php.\n") file( APPEND ${SPEC_FILE} "#\n") file( APPEND ${SPEC_FILE} "# To contact Novell about this file by physical or electronic mail,\n") file( APPEND ${SPEC_FILE} "# you may find current contact information at www.novell.com.\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "Summary: DigitalMe\n") file( APPEND ${SPEC_FILE} "Url: http://www.digitalme.com\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "Name: ${PROJECT_NAME}\n") file( APPEND ${SPEC_FILE} "Version: ${PACKAGE_VERSION}\n") file( APPEND ${SPEC_FILE} "Release: 1.1\n") file( APPEND ${SPEC_FILE} "License: Eclipse Public License, see http://www.eclipse.org/legal\n") file( APPEND ${SPEC_FILE} "Group: Productivity/Security\n") file( APPEND ${SPEC_FILE} "Source: %{name}-%{version}.tar.bz2\n") file( APPEND ${SPEC_FILE} "BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build\n") 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") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%description\n") file( APPEND ${SPEC_FILE} "A Microsoft CardSpace compatible identity selector\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%if 0%{?suse_version}\n") file( APPEND ${SPEC_FILE} "%define firefox MozillaFirefox\n") file( APPEND ${SPEC_FILE} "%else\n") file( APPEND ${SPEC_FILE} "%define firefox firefox\n") file( APPEND ${SPEC_FILE} "%endif\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%package firefox\n") file( APPEND ${SPEC_FILE} "License: Eclipse Public License, see http://www.eclipse.org/legal\n") file( APPEND ${SPEC_FILE} "Summary: DigitalMe Firefox Add-on\n") file( APPEND ${SPEC_FILE} "Group: Productivity/Security\n") file( APPEND ${SPEC_FILE} "Requires: digitalme = %{version}\n") file( APPEND ${SPEC_FILE} "Requires: %{firefox}\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%description firefox\n") file( APPEND ${SPEC_FILE} "Firefox Add-on for DigitalMe, a Microsoft CardSpace compatible identity selector.\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%prep\n") file( APPEND ${SPEC_FILE} "%setup -q\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%build\n") 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") file( APPEND ${SPEC_FILE} "make\n") file( APPEND ${SPEC_FILE} "pushd launchers/firefox-addon\n") 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") file( APPEND ${SPEC_FILE} "make xpi-jar\n") file( APPEND ${SPEC_FILE} "popd\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%install\n") file( APPEND ${SPEC_FILE} "make install DESTDIR=%{buildroot}\n") file( APPEND ${SPEC_FILE} "mkdir -p %{buildroot}%{_libdir}/firefox/extensions\n") file( APPEND ${SPEC_FILE} "cp -a launchers/firefox-addon/build/package-stage %{buildroot}%{_libdir}/firefox/extensions/{b65efa6d-ca84-4226-bde7-8feee2f62519}\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%files -f install_manifest.txt\n") file( APPEND ${SPEC_FILE} "%defattr\(-,root,root\)\n") file( APPEND ${SPEC_FILE} "%doc AUTHORS COPYING COPYRIGHT\n") file( APPEND ${SPEC_FILE} "%dir %{_libdir}/%{name}\n") file( APPEND ${SPEC_FILE} "%dir %{_datadir}/%{name}\n") file( APPEND ${SPEC_FILE} "%dir %{_datadir}/%{name}/certs\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%files firefox\n") file( APPEND ${SPEC_FILE} "%defattr(-,root,root,-)\n") file( APPEND ${SPEC_FILE} "%dir %{_libdir}/firefox\n") file( APPEND ${SPEC_FILE} "%dir %{_libdir}/firefox/extensions\n") file( APPEND ${SPEC_FILE} "%{_libdir}/firefox/extensions/{b65efa6d-ca84-4226-bde7-8feee2f62519}\n") file( APPEND ${SPEC_FILE} "\n") file( APPEND ${SPEC_FILE} "%changelog\n") file( READ ChangeLog CHANGE_LOG_TEXT) file( APPEND ${SPEC_FILE} ${CHANGE_LOG_TEXT})