| 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 | # Create the file
|
|---|
| 37 |
|
|---|
| 38 | FILE( WRITE ${SPEC_FILE} "Summary: DigitalMe\n")
|
|---|
| 39 | FILE( APPEND ${SPEC_FILE} "Name: ${PROJECT_NAME}\n")
|
|---|
| 40 | FILE( APPEND ${SPEC_FILE} "Version: ${PACKAGE_VERSION}\n")
|
|---|
| 41 | FILE( APPEND ${SPEC_FILE} "Release: 1.1\n")
|
|---|
| 42 | FILE( APPEND ${SPEC_FILE} "License: Eclipse Public License, see http://www.eclipse.org/legal\n")
|
|---|
| 43 | FILE( APPEND ${SPEC_FILE} "Group: Productivity/Security\n")
|
|---|
| 44 | FILE( APPEND ${SPEC_FILE} "Source: ${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz\n")
|
|---|
| 45 | FILE( APPEND ${SPEC_FILE} "BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root\n")
|
|---|
| 46 | 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\n")
|
|---|
| 47 | FILE( APPEND ${SPEC_FILE} "Requires: openssl >= 0.9.7 gnome-keyring >= 0.4 gtk2 >= 2.8 libglade2 >= 2.5\n")
|
|---|
| 48 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 49 |
|
|---|
| 50 | FILE( APPEND ${SPEC_FILE} "%description\n")
|
|---|
| 51 | FILE( APPEND ${SPEC_FILE} "A Microsoft CardSpace compatible identity selector\n")
|
|---|
| 52 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 53 |
|
|---|
| 54 | FILE( APPEND ${SPEC_FILE} "%prep\n")
|
|---|
| 55 | FILE( APPEND ${SPEC_FILE} "%setup -q\n")
|
|---|
| 56 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 57 |
|
|---|
| 58 | FILE( APPEND ${SPEC_FILE} "%build\n")
|
|---|
| 59 | FILE( APPEND ${SPEC_FILE} "./configure -DPROJECT_VERSION=${PACKAGE_VERSION} -DPRODUCT_INSTALL_PREFIX=${PRODUCT_INSTALL_PREFIX} -DDISABLE_SOURCE_INSTALL=YES\n")
|
|---|
| 60 | FILE( APPEND ${SPEC_FILE} "make\n")
|
|---|
| 61 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 62 |
|
|---|
| 63 | FILE( APPEND ${SPEC_FILE} "%install\n")
|
|---|
| 64 | FILE( APPEND ${SPEC_FILE} "make install DESTDIR=$RPM_BUILD_ROOT\n")
|
|---|
| 65 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 66 |
|
|---|
| 67 | FILE( APPEND ${SPEC_FILE} "%files -f install_manifest.txt\n")
|
|---|
| 68 | FILE( APPEND ${SPEC_FILE} "%dir ${PRODUCT_INSTALL_PREFIX}/lib/${PROJECT_NAME}\n")
|
|---|
| 69 | FILE( APPEND ${SPEC_FILE} "%dir ${PRODUCT_INSTALL_PREFIX}/share/${PROJECT_NAME}\n")
|
|---|
| 70 | FILE( APPEND ${SPEC_FILE} "%dir ${PRODUCT_INSTALL_PREFIX}/share/${PROJECT_NAME}/certs\n")
|
|---|
| 71 | FILE( APPEND ${SPEC_FILE} "%defattr\(-,root,root\)\n")
|
|---|
| 72 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 73 |
|
|---|
| 74 | FILE( APPEND ${SPEC_FILE} "%post\n")
|
|---|
| 75 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|
| 76 |
|
|---|
| 77 | FILE( APPEND ${SPEC_FILE} "%preun\n")
|
|---|
| 78 | FILE( APPEND ${SPEC_FILE} "\n")
|
|---|