File nsis.spec of Package nsis
#
# spec file for package nsis
#
# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: nsis
Version: 3.10
Release: 0
License: Zlib
Summary: A professional open source system to create Windows installers
Url: http://nsis.sourceforge.net/
Group: Development/Tools
Source0: %{name}-%{version}-src.tar.bz2
Source1: %{name}-%{version}.zip
Patch0: nsis-RPM_OPT_FLAGS.diff
BuildRequires: unzip scons gcc-c++ zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define SKIP_UTILS 'Library/RegTool,UIs,Makensisw,zip2exe,MakeLangId,NSIS Menu,SubStart'
%description
NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
%prep
%setup -q -D -n %{name}-%{version}-src
%patch0 -p1
%setup -q -T -D -b 1 -n %{name}-%{version}
%build
pushd ../%{name}-%{version}-src
export CCFLAGS="$RPM_OPT_FLAGS"
scons PREFIX=%{_prefix} SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=%{SKIP_UTILS} SKIPMISC=all VERSION=%{version} STRIP=false
popd
pushd ../%{name}-%{version}
# remove Win32-only files used at build time
rm -f Bin/GenPat.exe Bin/zip2exe.exe Bin/MakeLangId.exe
rm -f Examples/Plugin/nsis/pluginapi-*.lib
popd
%install
pushd ../%{name}-%{version}-src
scons PREFIX=%{_prefix} PREFIX_DEST=${RPM_BUILD_ROOT} PREFIX_CONF=%{_sysconfdir} SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=%{SKIP_UTILS} SKIPMISC=all VERSION=%{version} STRIP=false install
popd
pushd ../%{name}-%{version}
# install makensis data
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/doc/%{name}
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}
cp -fr Docs/ Examples/ ${RPM_BUILD_ROOT}%{_datadir}/doc/nsis
cp -fr Bin/ Contrib/ Include/ Plugins/ Stubs/ ${RPM_BUILD_ROOT}%{_datadir}/nsis
popd
# fix permissions
find ${RPM_BUILD_ROOT}%{_datadir}/doc/nsis -type f | xargs -I {} chmod -x "{}"
%files
%defattr(-,root,root)
%{_bindir}/makensis
%{_bindir}/GenPat
%config(noreplace) %{_sysconfdir}/nsisconf.nsh
%doc %{_datadir}/doc/nsis/
%{_datadir}/nsis/
%changelog