| 1 | # Conformance tests disabled by default since it requires 1 GB of test data | 
|---|
| 2 | #global runcheck 1 | 
|---|
| 3 |  | 
|---|
| 4 | #global optional_components 1 | 
|---|
| 5 |  | 
|---|
| 6 | Name:           openjpeg2 | 
|---|
| 7 | Version:        2.3.0 | 
|---|
| 8 | Release:        2%{?dist} | 
|---|
| 9 | Summary:        C-Library for JPEG 2000 | 
|---|
| 10 |  | 
|---|
| 11 | # windirent.h is MIT, the rest is BSD | 
|---|
| 12 | License:        BSD and MIT | 
|---|
| 13 | URL:            https://github.com/uclouvain/openjpeg | 
|---|
| 14 | Vendor: bww bitwise works GmbH | 
|---|
| 15 | %scm_source github http://github.com/bitwiseworks/openjpeg-os2 %{version}-os2 | 
|---|
| 16 | %if 0%{?runcheck} | 
|---|
| 17 | # git clone git@github.com:uclouvain/openjpeg-data.git | 
|---|
| 18 | Source1:        data.tar.xz | 
|---|
| 19 | %endif | 
|---|
| 20 |  | 
|---|
| 21 |  | 
|---|
| 22 | BuildRequires:  cmake | 
|---|
| 23 | # The library itself is C only, but there is some optional C++ stuff, hence the project is not marked as C-only in cmake and hence cmake looks for a c++ compiler | 
|---|
| 24 | #BuildRequires:  gcc-c++ | 
|---|
| 25 | BuildRequires:  gcc | 
|---|
| 26 | BuildRequires:  make | 
|---|
| 27 | BuildRequires:  zlib-devel | 
|---|
| 28 | BuildRequires:  libpng-devel | 
|---|
| 29 | BuildRequires:  libtiff-devel | 
|---|
| 30 | BuildRequires:  lcms2-devel | 
|---|
| 31 | BuildRequires:  doxygen | 
|---|
| 32 |  | 
|---|
| 33 | %if 0%{?optional_components} | 
|---|
| 34 | BuildRequires:  java-devel | 
|---|
| 35 | BuildRequires:  xerces-j2 | 
|---|
| 36 | %endif | 
|---|
| 37 |  | 
|---|
| 38 | %description | 
|---|
| 39 | The OpenJPEG library is an open-source JPEG 2000 library developed in order to | 
|---|
| 40 | promote the use of JPEG 2000. | 
|---|
| 41 |  | 
|---|
| 42 | This package contains | 
|---|
| 43 | * JPEG 2000 codec compliant with the Part 1 of the standard (Class-1 Profile-1 | 
|---|
| 44 | compliance). | 
|---|
| 45 | * JP2 (JPEG 2000 standard Part 2 - Handling of JP2 boxes and extended multiple | 
|---|
| 46 | component transforms for multispectral and hyperspectral imagery) | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | %package devel | 
|---|
| 50 | Summary:        Development files for OpenJPEG 2 | 
|---|
| 51 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 52 | # OpenJPEGTargets.cmake refers to the tools | 
|---|
| 53 | Requires:       %{name}-tools = %{version}-%{release} | 
|---|
| 54 |  | 
|---|
| 55 | %description devel | 
|---|
| 56 | The %{name}-devel package contains libraries and header files for developing | 
|---|
| 57 | applications that use OpenJPEG 2. | 
|---|
| 58 |  | 
|---|
| 59 |  | 
|---|
| 60 | %package devel-docs | 
|---|
| 61 | Summary:        Developer documentation for OpenJPEG 2 | 
|---|
| 62 | BuildArch:      noarch | 
|---|
| 63 |  | 
|---|
| 64 | %description devel-docs | 
|---|
| 65 | The %{name}-devel-docs package contains documentation files for developing | 
|---|
| 66 | applications that use OpenJPEG 2. | 
|---|
| 67 |  | 
|---|
| 68 |  | 
|---|
| 69 | %package tools | 
|---|
| 70 | Summary:        OpenJPEG 2 command line tools | 
|---|
| 71 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 72 |  | 
|---|
| 73 | %description tools | 
|---|
| 74 | Command line tools for JPEG 2000 file manipulation, using OpenJPEG2: | 
|---|
| 75 | * opj2_compress | 
|---|
| 76 | * opj2_decompress | 
|---|
| 77 | * opj2_dump | 
|---|
| 78 |  | 
|---|
| 79 | %if 0%{?optional_components} | 
|---|
| 80 | ##### MJ2 ##### | 
|---|
| 81 |  | 
|---|
| 82 | %package mj2 | 
|---|
| 83 | Summary:        OpenJPEG2 MJ2 module | 
|---|
| 84 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 85 |  | 
|---|
| 86 | %description mj2 | 
|---|
| 87 | The OpenJPEG library is an open-source JPEG 2000 library developed in order to | 
|---|
| 88 | promote the use of JPEG 2000. | 
|---|
| 89 |  | 
|---|
| 90 | This package contains the MJ2 module (JPEG 2000 standard Part 3) | 
|---|
| 91 |  | 
|---|
| 92 |  | 
|---|
| 93 | %package mj2-devel | 
|---|
| 94 | Summary:        Development files for OpenJPEG2 MJ2 module | 
|---|
| 95 | Requires:       %{name}-devel = %{version}-%{release} | 
|---|
| 96 | Requires:       %{name}-mj2 = %{version}-%{release} | 
|---|
| 97 |  | 
|---|
| 98 | %description mj2-devel | 
|---|
| 99 | Development files for OpenJPEG2 MJ2 module | 
|---|
| 100 |  | 
|---|
| 101 |  | 
|---|
| 102 | %package mj2-tools | 
|---|
| 103 | Summary:        OpenJPEG2 MJ2 module command line tools | 
|---|
| 104 | Requires:       %{name}-mj2 = %{version}-%{release} | 
|---|
| 105 |  | 
|---|
| 106 | %description mj2-tools | 
|---|
| 107 | OpenJPEG2 MJ2 module command line tools | 
|---|
| 108 |  | 
|---|
| 109 | ##### JPWL ##### | 
|---|
| 110 |  | 
|---|
| 111 | %package jpwl | 
|---|
| 112 | Summary:        OpenJPEG2 JPWL module | 
|---|
| 113 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 114 |  | 
|---|
| 115 | %description jpwl | 
|---|
| 116 | The OpenJPEG library is an open-source JPEG 2000 library developed in order to | 
|---|
| 117 | promote the use of JPEG 2000. | 
|---|
| 118 |  | 
|---|
| 119 | This package contains the JPWL (JPEG 2000 standard Part 11 - Jpeg 2000 Wireless) | 
|---|
| 120 |  | 
|---|
| 121 |  | 
|---|
| 122 | %package jpwl-devel | 
|---|
| 123 | Summary:        Development files for OpenJPEG2 JPWL module | 
|---|
| 124 | Requires:       %{name}-devel = %{version}-%{release} | 
|---|
| 125 | Requires:       %{name}-jpwl = %{version}-%{release} | 
|---|
| 126 |  | 
|---|
| 127 | %description jpwl-devel | 
|---|
| 128 | Development files for OpenJPEG2 JPWL module | 
|---|
| 129 |  | 
|---|
| 130 |  | 
|---|
| 131 | %package jpwl-tools | 
|---|
| 132 | Summary:        OpenJPEG2 JPWL module command line tools | 
|---|
| 133 | Requires:       %{name}-jpwl = %{version}-%{release} | 
|---|
| 134 |  | 
|---|
| 135 | %description jpwl-tools | 
|---|
| 136 | OpenJPEG2 JPWL module command line tools | 
|---|
| 137 |  | 
|---|
| 138 | ##### JPIP ##### | 
|---|
| 139 |  | 
|---|
| 140 | %package jpip | 
|---|
| 141 | Summary:        OpenJPEG2 JPIP module | 
|---|
| 142 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 143 |  | 
|---|
| 144 | %description jpip | 
|---|
| 145 | The OpenJPEG library is an open-source JPEG 2000 library developed in order to | 
|---|
| 146 | promote the use of JPEG 2000. | 
|---|
| 147 |  | 
|---|
| 148 | This package contains the JPWL (JPEG 2000 standard Part 9 - Jpeg 2000 Interactive Protocol) | 
|---|
| 149 |  | 
|---|
| 150 |  | 
|---|
| 151 | %package jpip-devel | 
|---|
| 152 | Summary:        Development files for OpenJPEG2 JPIP module | 
|---|
| 153 | Requires:       %{name}-devel = %{version}-%{release} | 
|---|
| 154 | Requires:       %{name}-jpwl = %{version}-%{release} | 
|---|
| 155 |  | 
|---|
| 156 | %description jpip-devel | 
|---|
| 157 | Development files for OpenJPEG2 JPIP module | 
|---|
| 158 |  | 
|---|
| 159 |  | 
|---|
| 160 | %package jpip-tools | 
|---|
| 161 | Summary:        OpenJPEG2 JPIP module command line tools | 
|---|
| 162 | Requires:       %{name}-jpip = %{version}-%{release} | 
|---|
| 163 | Requires:       jpackage-utils | 
|---|
| 164 | Requires:       java | 
|---|
| 165 |  | 
|---|
| 166 | %description jpip-tools | 
|---|
| 167 | OpenJPEG2 JPIP module command line tools | 
|---|
| 168 |  | 
|---|
| 169 | ##### JP3D ##### | 
|---|
| 170 |  | 
|---|
| 171 | %package jp3d | 
|---|
| 172 | Summary:        OpenJPEG2 JP3D module | 
|---|
| 173 | Requires:       %{name} = %{version}-%{release} | 
|---|
| 174 |  | 
|---|
| 175 | %description jp3d | 
|---|
| 176 | The OpenJPEG library is an open-source JPEG 2000 library developed in order to | 
|---|
| 177 | promote the use of JPEG 2000. | 
|---|
| 178 |  | 
|---|
| 179 | This package contains the JP3D (JPEG 2000 standard Part 10 - Jpeg 2000 3D) | 
|---|
| 180 |  | 
|---|
| 181 |  | 
|---|
| 182 | %package jp3d-devel | 
|---|
| 183 | Summary:        Development files for OpenJPEG2 JP3D module | 
|---|
| 184 | Requires:       %{name}-devel = %{version}-%{release} | 
|---|
| 185 | Requires:       %{name}-jp3d = %{version}-%{release} | 
|---|
| 186 |  | 
|---|
| 187 | %description jp3d-devel | 
|---|
| 188 | Development files for OpenJPEG2 JP3D module | 
|---|
| 189 |  | 
|---|
| 190 |  | 
|---|
| 191 | %package jp3d-tools | 
|---|
| 192 | Summary:        OpenJPEG2 JP3D module command line tools | 
|---|
| 193 | Requires:       %{name}-jp3d = %{version}-%{release} | 
|---|
| 194 |  | 
|---|
| 195 | %description jp3d-tools | 
|---|
| 196 | OpenJPEG2 JP3D module command line tools | 
|---|
| 197 | %endif | 
|---|
| 198 |  | 
|---|
| 199 | %debug_package | 
|---|
| 200 |  | 
|---|
| 201 |  | 
|---|
| 202 | %prep | 
|---|
| 203 | %scm_setup | 
|---|
| 204 |  | 
|---|
| 205 | # Remove all third party libraries just to be sure | 
|---|
| 206 | #rm -rf thirdparty | 
|---|
| 207 |  | 
|---|
| 208 |  | 
|---|
| 209 | %build | 
|---|
| 210 | export LDFLAGS="-Zhigh-mem -Zomf -lcx" | 
|---|
| 211 | export VENDOR="%{vendor}" | 
|---|
| 212 | export CFLAGS="%{optflags} -mno-sse" | 
|---|
| 213 | export CXXFLAGS="%{optflags} -mno-sse" | 
|---|
| 214 |  | 
|---|
| 215 | mkdir build | 
|---|
| 216 | cd build | 
|---|
| 217 | # TODO: Consider | 
|---|
| 218 | # -DBUILD_JPIP_SERVER=ON -DBUILD_JAVA=ON | 
|---|
| 219 | %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENJPEG_INSTALL_LIB_DIR=%{_lib} \ | 
|---|
| 220 | %{?optional_components:-DBUILD_MJ2=ON -DBUILD_JPWL=ON -DBUILD_JPIP=ON -DBUILD_JP3D=ON} \ | 
|---|
| 221 | -DBUILD_DOC=ON \ | 
|---|
| 222 | -DBUILD_STATIC_LIBS=OFF \ | 
|---|
| 223 | -DBUILD_SHARED_LIBS=ON \ | 
|---|
| 224 | %{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data} \ | 
|---|
| 225 | .. | 
|---|
| 226 | cd .. | 
|---|
| 227 |  | 
|---|
| 228 | make VERBOSE=1 -C build | 
|---|
| 229 |  | 
|---|
| 230 |  | 
|---|
| 231 | %install | 
|---|
| 232 | %make_install -C build | 
|---|
| 233 |  | 
|---|
| 234 |  | 
|---|
| 235 | # Docs are installed through %%doc | 
|---|
| 236 | rm -rf %{buildroot}%{_datadir}/doc/ | 
|---|
| 237 |  | 
|---|
| 238 | %if 0%{?optional_components} | 
|---|
| 239 | # Move the jar to the correct place | 
|---|
| 240 | mkdir -p %{buildroot}%{_javadir} | 
|---|
| 241 | mv %{buildroot}%{_datadir}/opj_jpip_viewer.jar %{buildroot}%{_javadir}/opj2_jpip_viewer.jar | 
|---|
| 242 | cat > %{buildroot}%{_bindir}/opj2_jpip_viewer <<EOF | 
|---|
| 243 | java -jar %{_javadir}/opj2_jpip_viewer.jar "$@" | 
|---|
| 244 | EOF | 
|---|
| 245 | chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer | 
|---|
| 246 | %endif | 
|---|
| 247 |  | 
|---|
| 248 |  | 
|---|
| 249 | #%ldconfig_scriptlets | 
|---|
| 250 |  | 
|---|
| 251 |  | 
|---|
| 252 | %check | 
|---|
| 253 | %if 0%{?runcheck} | 
|---|
| 254 | make test -C build | 
|---|
| 255 | %endif | 
|---|
| 256 |  | 
|---|
| 257 |  | 
|---|
| 258 | %files | 
|---|
| 259 | %{!?_licensedir:%global license %doc} | 
|---|
| 260 | %license LICENSE | 
|---|
| 261 | %doc AUTHORS.md NEWS.md README.md THANKS.md | 
|---|
| 262 | %{_libdir}/openjp*.dll | 
|---|
| 263 | %{_mandir}/man3/libopenjp2.3* | 
|---|
| 264 |  | 
|---|
| 265 | %files devel | 
|---|
| 266 | %dir %{_includedir}/openjpeg-2.3/ | 
|---|
| 267 | %{_includedir}/openjpeg-2.3/openjpeg.h | 
|---|
| 268 | %{_includedir}/openjpeg-2.3/opj_config.h | 
|---|
| 269 | %{_includedir}/openjpeg-2.3/opj_stdint.h | 
|---|
| 270 | %{_libdir}/openjp*_dll.a | 
|---|
| 271 | %{_libdir}/openjpeg-2.3/ | 
|---|
| 272 | %{_libdir}/pkgconfig/libopenjp2.pc | 
|---|
| 273 |  | 
|---|
| 274 | %files devel-docs | 
|---|
| 275 | %doc build/doc/html | 
|---|
| 276 |  | 
|---|
| 277 | %files tools | 
|---|
| 278 | %{_bindir}/opj_compress.exe | 
|---|
| 279 | %{_bindir}/opj_decompress.exe | 
|---|
| 280 | %{_bindir}/opj_dump.exe | 
|---|
| 281 | %{_mandir}/man1/opj_compress.1* | 
|---|
| 282 | %{_mandir}/man1/opj_decompress.1* | 
|---|
| 283 | %{_mandir}/man1/opj_dump.1* | 
|---|
| 284 |  | 
|---|
| 285 | %if 0%{?optional_components} | 
|---|
| 286 | %files mj2 | 
|---|
| 287 | %{_libdir}/libopenmj2.so.* | 
|---|
| 288 |  | 
|---|
| 289 | %files mj2-devel | 
|---|
| 290 | %{_libdir}/libopenmj2.so | 
|---|
| 291 |  | 
|---|
| 292 | %files mj2-tools | 
|---|
| 293 | %{_bindir}/opj2_mj2* | 
|---|
| 294 |  | 
|---|
| 295 | %files jpwl | 
|---|
| 296 | %{_libdir}/libopenjpwl.so.* | 
|---|
| 297 |  | 
|---|
| 298 | %files jpwl-devel | 
|---|
| 299 | %{_libdir}/libopenjpwl.so | 
|---|
| 300 | %{_libdir}/pkgconfig/libopenjpwl.pc | 
|---|
| 301 |  | 
|---|
| 302 | %files jpwl-tools | 
|---|
| 303 | %{_bindir}/opj2_jpwl* | 
|---|
| 304 |  | 
|---|
| 305 | %files jpip | 
|---|
| 306 | %{_libdir}/libopenjpip.so.* | 
|---|
| 307 |  | 
|---|
| 308 | %files jpip-devel | 
|---|
| 309 | %{_libdir}/libopenjpip.so | 
|---|
| 310 | %{_libdir}/pkgconfig/libopenjpip.pc | 
|---|
| 311 |  | 
|---|
| 312 | %files jpip-tools | 
|---|
| 313 | %{_bindir}/opj2_jpip* | 
|---|
| 314 | %{_bindir}/opj2_dec_server | 
|---|
| 315 | %{_javadir}/opj2_jpip_viewer.jar | 
|---|
| 316 |  | 
|---|
| 317 | %files jp3d | 
|---|
| 318 | %{_libdir}/libopenjp3d.so.* | 
|---|
| 319 |  | 
|---|
| 320 | %files jp3d-devel | 
|---|
| 321 | %{_includedir}/openjpeg-2.0/openjp3d.h | 
|---|
| 322 | %{_libdir}/libopenjp3d.so | 
|---|
| 323 | %{_libdir}/pkgconfig/libopenjp3d.pc | 
|---|
| 324 |  | 
|---|
| 325 | %files jp3d-tools | 
|---|
| 326 | %{_bindir}/opj2_jp3d* | 
|---|
| 327 | %endif | 
|---|
| 328 |  | 
|---|
| 329 |  | 
|---|
| 330 | %changelog | 
|---|
| 331 | * Wed Mar 27 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.3.0-2 | 
|---|
| 332 | - disable sse | 
|---|
| 333 |  | 
|---|
| 334 | * Fri Nov 2 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.3.0-1 | 
|---|
| 335 | - initial port | 
|---|