summaryrefslogtreecommitdiffstats
path: root/cygwin-openssl.spec
blob: f0d035fdcd2328d5162ba30a271e01766096a286 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
%{?cygwin_package_header}

%define soversion 1.0.0

Name:           cygwin-openssl
Version:        1.0.2m
Release:        1%{?dist}
Summary:        Cygwin port of the OpenSSL toolkit

Group:          Development/Libraries
License:        OpenSSL
URL:            http://www.openssl.org/
BuildArch:      noarch

Source0:        http://www.openssl.org/source/openssl-%{version}.tar.gz
Patch0:         openssl-1.0.2i-enginesdir.patch
Patch1:         openssl-1.0.2-debuginfo.patch

BuildRequires:  cygwin32-filesystem
BuildRequires:  cygwin32-binutils
BuildRequires:  cygwin32-gcc
BuildRequires:  cygwin32
BuildRequires:  cygwin32-zlib

BuildRequires:  cygwin64-filesystem
BuildRequires:  cygwin64-binutils
BuildRequires:  cygwin64-gcc
BuildRequires:  cygwin64
BuildRequires:  cygwin64-zlib

BuildRequires:  perl
BuildRequires:  sed
BuildRequires:  /usr/bin/cmp
BuildRequires:  /usr/bin/mktemp
BuildRequires:  /usr/bin/rename
# The build script uses /usr/bin/makedepend which comes from imake.
# We also use lndir below to set up duplicate build trees
BuildRequires:  imake


%description
OpenSSL encryption toolkit for Cygwin toolchains.

%package -n cygwin32-openssl
Summary:        Cygwin32 OpenSSL libraries
Group:          Development/Libraries

%description -n cygwin32-openssl
OpenSSL encryption toolkit for the Cygwin i686 toolchain.

%package -n cygwin64-openssl
Summary:        Cygwin64 OpenSSL libraries
Group:          Development/Libraries

%description -n cygwin64-openssl
OpenSSL encryption toolkit for the Cygwin x86_64 toolchain.

%{?cygwin_debug_package}


%prep
%setup -q -n openssl-%{version}
%patch0 -p1
%patch1 -p2

if ! iconv -f UTF-8 -t ASCII//TRANSLIT CHANGES >/dev/null 2>&1 ; then
  iconv -f ISO-8859-1 -t UTF-8 -o CHANGES.utf8 CHANGES && \
    mv -f CHANGES.utf8 CHANGES
fi


%build
# openssl must be built in-tree
mkdir -p ../build_32bit ../build_64bit
lndir -silent `pwd` ../build_32bit
lndir -silent `pwd` ../build_64bit
mv ../build_32bit ../build_64bit .

pushd build_32bit
./Configure \
  --prefix=%{cygwin32_prefix} \
  --cross-compile-prefix=%{cygwin32_target}- \
  shared zlib enable-seed enable-tlsext enable-rfc3779 enable-camellia \
  enable-cms enable-md2 enable-rc5 no-krb5 Cygwin

make depend
make all build-shared
popd


mkdir -p build_64bit
pushd build_64bit
./Configure \
  --prefix=%{cygwin64_prefix} \
  --cross-compile-prefix=%{cygwin64_target}- \
  shared zlib enable-seed enable-tlsext enable-rfc3779 enable-camellia \
  enable-cms enable-md2 enable-rc5 no-krb5 Cygwin-x86_64

make depend
make all build-shared OPT_CFLAGS="$CFLAGS" EXE_EXT=.exe
popd


%install
pushd build_32bit
make INSTALL_PREFIX=$RPM_BUILD_ROOT install_sw EXE_EXT=.exe
popd
pushd build_64bit
make INSTALL_PREFIX=$RPM_BUILD_ROOT install_sw EXE_EXT=.exe
popd

# Remove unnecessary static libraries
rm -f $RPM_BUILD_ROOT%{cygwin32_libdir}/lib{crypto,ssl}.a
rm -f $RPM_BUILD_ROOT%{cygwin64_libdir}/lib{crypto,ssl}.a

# Remove unnecessary Cygwin native binaries and runtime files
rm -f $RPM_BUILD_ROOT%{cygwin32_bindir}/c_rehash
rm -f $RPM_BUILD_ROOT%{cygwin32_bindir}/*.exe
rm -rf $RPM_BUILD_ROOT%{cygwin32_libdir}/engines/
rm -rf $RPM_BUILD_ROOT%{cygwin32_prefix}/ssl

rm -f $RPM_BUILD_ROOT%{cygwin64_bindir}/c_rehash
rm -f $RPM_BUILD_ROOT%{cygwin64_bindir}/*.exe
rm -rf $RPM_BUILD_ROOT%{cygwin64_libdir}/engines/
rm -rf $RPM_BUILD_ROOT%{cygwin64_prefix}/ssl

# Documentation already provided by Fedora native package
rm -rf $RPM_BUILD_ROOT%{cygwin32_mandir}
rm -rf $RPM_BUILD_ROOT%{cygwin64_mandir}


%files -n cygwin32-openssl
%doc CHANGES LICENSE NEWS
%{cygwin32_bindir}/cygcrypto-%{soversion}.dll
%{cygwin32_bindir}/cygssl-%{soversion}.dll
%{cygwin32_includedir}/openssl
%{cygwin32_libdir}/libcrypto.dll.a
%{cygwin32_libdir}/libssl.dll.a
%{cygwin32_libdir}/pkgconfig/libcrypto.pc
%{cygwin32_libdir}/pkgconfig/libssl.pc
%{cygwin32_libdir}/pkgconfig/openssl.pc

%files -n cygwin64-openssl
%doc CHANGES LICENSE NEWS
%{cygwin64_bindir}/cygcrypto-%{soversion}.dll
%{cygwin64_bindir}/cygssl-%{soversion}.dll
%{cygwin64_includedir}/openssl
%{cygwin64_libdir}/libcrypto.dll.a
%{cygwin64_libdir}/libssl.dll.a
%{cygwin64_libdir}/pkgconfig/libcrypto.pc
%{cygwin64_libdir}/pkgconfig/libssl.pc
%{cygwin64_libdir}/pkgconfig/openssl.pc


%changelog
* Tue Dec 05 2017 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.2m-1
- new version

* Sun Sep 11 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.2h-1
- Version bump.

* Tue Apr 08 2014 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1g-1
- Version bump.

* Thu Jan 23 2014 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1f-1
- Version bump.

* Tue Jul 02 2013 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1e-2
- Rebuild for new Cygwin packaging scheme.
- Add cygwin64 package.

* Sun Feb 17 2013 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1e-1
- Version bump.

* Thu May 24 2012 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1c-1
- Version bump.

* Tue Mar 20 2012 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.1-1
- Version bump.
- Remove unnecessary files.

* Sun Mar 20 2011 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 0.9.8r-1
- Initial spec file, largely based on mingw32-openssl.