summaryrefslogtreecommitdiff
path: root/nsis.spec
blob: c1a6b1760e734b068799b12030f7c8960ebaf85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Summary:	Open Source installer build tool for Windows applications
Name:		nsis
Version:	2.34
Release:	0.1
License:	zlib/libpng
Group:		Development/Tools
URL:		http://nsis.sourceforge.net/
Source0:	http://downloads.sourceforge.net/nsis/%{name}-%{version}-src.tar.bz2
# Source0-md5:	60243c2562710eeac45bda1378e4c88c
Source1:	http://downloads.sourceforge.net/nsis/%{name}-%{version}.zip
# Source1-md5:	565d17b3ff12dffcf678ec252a892c04
Patch0:		optflags.patch
BuildRequires:	libstdc++-devel
BuildRequires:	scons >= 0.96.93
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%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 -n %{name}-%{version}-src -a1
%{__cp} -aux %{name}-%{version}/* .
%patch0 -p1

%{__rm} -rf Docs/StrFunc

%build
# build & install must use exactly same args to cmake, so make shell wrapper
# not to mistake.
cat <<'EOF' > build.sh
#!/bin/sh
%scons "$@" \
	APPEND_CCFLAGS="%{rpmcflags}" \
	APPEND_CXXFLAGS="%{rpmcxxflags}" \
	APPEND_LINKFLAGS="%{rpmldflags}" \
	PREFIX=%{_prefix} \
	PREFIX_DEST=$RPM_BUILD_ROOT \
	PREFIX_CONF=%{_sysconfdir} \
	SKIPSTUBS="all" \
	SKIPPLUGINS="all" \
	SKIPUTILS="Library/RegTool,UIs,Makensisw,zip2exe,MakeLangId,NSIS Menu" \
	SKIPMISC="all" \
	VERSION="%{version}" \
	STRIP="false"
EOF
chmod a+rx build.sh
./build.sh

%install
rm -rf $RPM_BUILD_ROOT
./build.sh install

install -d $RPM_BUILD_ROOT%{_datadir}/nsis
cp -fr Bin Contrib Include Menu Plugins Stubs $RPM_BUILD_ROOT%{_datadir}/nsis

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc COPYING Docs Examples
%config(noreplace) %{_sysconfdir}/nsisconf.nsh
%attr(755,root,root) %{_bindir}/GenPat
%attr(755,root,root) %{_bindir}/LibraryLocal
%attr(755,root,root) %{_bindir}/makensis
%{_datadir}/nsis
%exclude %{_datadir}/doc/nsis