liquibase.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. # Settings
  2. %define packagedby "Nathan Voxland <nathan@voxland.net>"
  3. # Enable / Disable sub-packages
  4. %define mysql 0
  5. %define oracle 0
  6. %define postgresql 0
  7. %define mssql 0
  8. %define sqlite 0
  9. # Liquibase Package
  10. %define lqver 3.6.0
  11. %define buildnum 1
  12. ## MySQL Jar
  13. %define mysqljar mysql-connector-java-6.0.6.jar
  14. %define gpl2license gpl-2.0.txt
  15. ## Oracle Files
  16. %define oraLicense oracle-license.txt
  17. %define orajarjdbc ojdbc8-12.1.0.2.jar
  18. %define orajarucp ucp-12.1.0.2.jar
  19. %define orajari18n orai18n.jar
  20. ## Postgresql
  21. %define pgsqljar postgresql-42.1.1.jar
  22. %define bsdLicense BSD-License.txt
  23. ## Microsoft SQL
  24. %define mssqljar mssql-sqljdbc4-2.0.jar
  25. %define msLicense MsSQLLicense.txt
  26. ## SQLite
  27. %define sqlitejar sqlite-jdbc-3.6.20.1.jar
  28. %define apache2license apache2license.txt
  29. Name: liquibase
  30. Summary: Liquibase Database Refactoring Tool
  31. Version: %{lqver}
  32. Release: %{buildnum}%{?dist}
  33. License: Apache 2.0
  34. Group: Applications/Databases
  35. Source0: %{name}-%{version}.tar.gz
  36. Source1: %{mysqljar}
  37. Source2: %{oraLicense}
  38. Source3: %{orajarjdbc}
  39. Source4: %{orajarucp}
  40. Source5: %{orajari18n}
  41. Source6: %{pgsqljar}
  42. Source7: %{bsdLicense}
  43. Source8: %{mssqljar}
  44. Source9: %{msLicense}
  45. Source10: %{gpl2license}
  46. Source11: %{sqlitejar}
  47. Source12: %{apache2license}
  48. BuildRoot: %{_tmppath}/build-root-%{name}
  49. BuildArch: noarch
  50. Packager: %{packagedby}
  51. Url: http://liquibase.org/
  52. Vendor: LiquiBase (http://www.liquibase.org)
  53. Provides: liquibase = %{version}-%{release}
  54. %description
  55. LiquiBase is an open source (Apache 2.0 License), database-independent library for tracking,
  56. managing and applying database changes. It is built on a simple premise: All
  57. database changes are stored in a human readable yet trackable form and checked
  58. into source control.
  59. %if %{mysql}
  60. %package mysql
  61. Summary: MySQL Jar file
  62. Group: Development/Languages
  63. Requires: liquibase
  64. License: GPL
  65. Url: http://dev.mysql.com/downloads/connector/j/
  66. %description mysql
  67. This package includes the MySQL jar file required by liquibase
  68. %endif
  69. %if %{oracle}
  70. %package oracle
  71. Summary: Oracle Jar and license files
  72. Group: Development/Languages
  73. Requires: liquibase
  74. License: Commerical
  75. Url: http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html
  76. %description oracle
  77. This package includes the Oracle jar file required by liquibase
  78. %endif
  79. %if %{postgresql}
  80. %package postgresql
  81. Summary: PostgreSQL Jar file
  82. Group: Development/Languages
  83. Requires: liquibase
  84. License: BSD
  85. Url: http://jdbc.postgresql.org/download.html
  86. %description postgresql
  87. This package includes the PostgreSQL jar file required by liquibase as well
  88. as the BSD license that PostgreSQL is licensed under.
  89. %endif
  90. %if %{mssql}
  91. %package mssql
  92. Summary: Microsoft SQL Jar file
  93. Group: Development/Languages
  94. Requires: liquibase
  95. License: Commercial
  96. Url: http://www.microsoft.com/downloads/details.aspx?FamilyID=99b21b65-e98f-4a61-b811-19912601fdc9&displaylang=en
  97. %description mssql
  98. This package includes the Microsoft JDBC 2.0 jar file required by liquibase
  99. as well as the license the jar is licensed under. This release of the JDBC
  100. Driver is JDBC 4.0 compliant and runs on the Java Development Kit (JDK)
  101. version 5.0 or later.
  102. %endif
  103. %if %{sqlite}
  104. %package sqlite
  105. Summary: Sqlite Jar file
  106. Group: Development/Languages
  107. Requires: liquibase
  108. License: Apache License
  109. Url: https://github.com/xerial/sqlite-jdbc
  110. %description sqlite
  111. This package includes the Sqlite jar file required by liquibase as well
  112. as the Apache 2 license. The jar file includes native libraries for Linux
  113. (i386 and x86_64), Windows (i386 and x86_64), and MacOSX (i386 and x86_64).
  114. If the library is used on a platform where native extensions are not available,
  115. the pure java version will be used instead.
  116. %endif
  117. %pre
  118. %prep
  119. %setup -q -n %{name}-%{version}
  120. %patch0 -p1
  121. %build
  122. %install
  123. %{__rm} -rf %{buildroot}
  124. %{__mkdir} -p %{buildroot}%{_libdir}/%{name}/lib/
  125. %{__mkdir} -p %{buildroot}%{_bindir}
  126. %{__install} -m 0644 -D -p %{name}-%{version}.jar %{buildroot}%{_libdir}/%{name}
  127. %{__install} -m 0755 -D -p %{name} %{buildroot}%{_bindir}
  128. # Profile.d file
  129. %{__mkdir} -p %{buildroot}%{_sysconfdir}/profile.d/
  130. %{__cat} <<EOF >%{buildroot}%{_sysconfdir}/profile.d/liquibase.sh
  131. export LIQUIBASE_HOME=%{_libdir}/%{name}/
  132. EOF
  133. # Sub-packages
  134. %if %{mysql}
  135. %{__install} -m 0644 -D -p %{SOURCE1} %{buildroot}%{_libdir}/%{name}/lib/
  136. %{__install} -m 0644 -D -p %{SOURCE9} %{buildroot}%{_libdir}/%{name}/lib/
  137. %endif
  138. %if %{oracle}
  139. %{__install} -m 0644 -D -p %{SOURCE2} %{buildroot}%{_libdir}/%{name}/lib/
  140. %{__install} -m 0644 -D -p %{SOURCE3} %{buildroot}%{_libdir}/%{name}/lib/
  141. %{__install} -m 0644 -D -p %{SOURCE4} %{buildroot}%{_libdir}/%{name}/lib/
  142. %endif
  143. %if %{postgresql}
  144. %{__install} -m 0644 -D -p %{SOURCE5} %{buildroot}%{_libdir}/%{name}/lib/
  145. %{__install} -m 0644 -D -p %{SOURCE6} %{buildroot}%{_libdir}/%{name}/lib/
  146. %endif
  147. %if %{mssql}
  148. %{__install} -m 0644 -D -p %{SOURCE7} %{buildroot}%{_libdir}/%{name}/lib/
  149. %{__install} -m 0644 -D -p %{SOURCE8} %{buildroot}%{_libdir}/%{name}/lib/
  150. %endif
  151. %if %{sqlite}
  152. %{__install} -m 0644 -D -p %{SOURCE10} %{buildroot}%{_libdir}/%{name}/lib/
  153. %{__install} -m 0644 -D -p %{SOURCE11} %{buildroot}%{_libdir}/%{name}/lib/
  154. %endif
  155. %clean
  156. %{__rm} -rf %{buildroot}
  157. %files
  158. %defattr(-,root,root)
  159. %attr(0755,root,root) %{_sysconfdir}/profile.d/%{name}.sh
  160. %doc docs/* changelog.txt LICENSE.txt
  161. %{_libdir}/%{name}
  162. %{_bindir}/%{name}
  163. %if %{mysql}
  164. %exclude %{_libdir}/%{name}/lib/%{mysqljar}
  165. %exclude %{_libdir}/%{name}/lib/%{gpl2license}
  166. %endif
  167. %if %{oracle}
  168. %exclude %{_libdir}/%{name}/lib/%{oraLicense}
  169. %exclude %{_libdir}/%{name}/lib/%{orajarjdbc}
  170. %exclude %{_libdir}/%{name}/lib/%{orajari18n}
  171. %endif
  172. %if %{postgresql}
  173. %exclude %{_libdir}/%{name}/lib/%{pgsqljar}
  174. %exclude %{_libdir}/%{name}/lib/%{bsdLicense}
  175. %endif
  176. %if %{mssql}
  177. %exclude %{_libdir}/%{name}/lib/%{mssqljar}
  178. %exclude %{_libdir}/%{name}/lib/%{msLicense}
  179. %endif
  180. %if %{sqlite}
  181. %exclude %{_libdir}/%{name}/lib/%{sqlitejar}
  182. %exclude %{_libdir}/%{name}/lib/%{apache2license}
  183. %endif
  184. %if %{mysql}
  185. %files mysql
  186. %defattr(0644,root,root)
  187. %{_libdir}/%{name}/lib/%{mysqljar}
  188. %{_libdir}/%{name}/lib/%{gpl2license}
  189. %endif
  190. %if %{oracle}
  191. %files oracle
  192. %defattr(0644,root,root)
  193. %{_libdir}/%{name}/lib/%{oraLicense}
  194. %{_libdir}/%{name}/lib/%{orajarjdbc}
  195. %{_libdir}/%{name}/lib/%{orajari18n}
  196. %endif
  197. %if %{postgresql}
  198. %files postgresql
  199. %defattr(0644,root,root)
  200. %{_libdir}/%{name}/lib/%{pgsqljar}
  201. %{_libdir}/%{name}/lib/%{bsdLicense}
  202. %endif
  203. %if %{mssql}
  204. %files mssql
  205. %defattr(0644,root,root)
  206. %{_libdir}/%{name}/lib/%{mssqljar}
  207. %{_libdir}/%{name}/lib/%{msLicense}
  208. %endif
  209. %if %{sqlite}
  210. %files sqlite
  211. %defattr(0644,root,root)
  212. %{_libdir}/%{name}/lib/%{sqlitejar}
  213. %{_libdir}/%{name}/lib/%{apache2license}
  214. %endif
  215. %post
  216. %changelog
  217. * Thu Jul 13 2017 Andreas Buschka <kontakt@andreas-buschka.de>
  218. - Updated JDBC libraries and URLs.
  219. * Mon Jan 25 2010 William Lovins <rpmbuild@icainformatics.com> - 1.9.5-1
  220. - initial public version of spec