Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:infrastructure:wiki
elasticsearch5
elasticsearch5.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File elasticsearch5.spec of Package elasticsearch5
# # spec file for package elasticsearch # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 kkaempf # # 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/ # %if 0%{?suse_version} > 1140 || 0%{?fedora_version} > 14 %define has_systemd 1 %else %define has_systemd 0 %endif # "backport" %{!?_initddir: %{expand: %%global _initddir %{_initrddir}}} %{!?_rundir: %{expand: %%global _rundir /run}} # these two are broken on SLE 11... so just "correct" them enough to work... %{!?_tmpfilesdir: %{expand: %%global _tmpfilesdir %{_prefix}/lib/tmpfiles.d}} %{!?_sysctldir: %{expand: %%global _sysctldir %{_prefix}/lib/sysctl.d}} %define prjname elasticsearch Name: %{prjname}5 Version: 5.6.16 Release: 0 Summary: Open Source, Distributed, RESTful Search Engine License: Apache-2.0 Group: Productivity/Databases/Tools Url: https://github.com/elastic/%{prjname} Source0: https://github.com/elastic/%{prjname}/archive/%{version}/%{prjname}-%{version}.tar.gz # upstream set the v5.6.16 tag wrongly. Revert last commit to get # version number right. Patch0: 0001-Bump-5.6-branch-to-version-5.6.17-40210.patch Patch1: 0001-Local-maven-repo.patch Patch2: 0002-Replace-build-variable-in-config-files.patch Source1: init.gradle Source2: %{prjname}.logrotate Source5: %{prjname}.tmpfiles.d Source7: %{prjname}.SuSEfirewall2 Source8: %{prjname}.init BuildRoot: %{_tmppath}/%{prjname}-%{version}-build BuildRequires: git BuildRequires: gradle4_3_1 BuildRequires: libjnidispatch %if 0%{?suse_version} < 1500 BuildRequires: libnative-platform0 %endif %if 0%{?suse_version} > 1010 BuildRequires: fdupes %endif # Java 1.7 triggers build problems BuildRequires: java-devel = 1.8.0 # %%{version} BuildRequires: %{name}-kit = %{version} %if 0%{?has_systemd} BuildRequires: systemd %{?systemd_requires} %endif # SLE_12 and Leap 42 need this: BuildRequires: mozilla-nss BuildArch: noarch Provides: mvn(org.elasticsearch:core) == %{version} Provides: mvn(org.elasticsearch:dev-tools) == %{version} Provides: mvn(org.elasticsearch:distribution) == %{version} Provides: mvn(org.elasticsearch:modules) == %{version} Provides: mvn(org.elasticsearch:plugins) == %{version} Provides: mvn(org.elasticsearch:qa) == %{version} Provides: mvn(org.elasticsearch:rest-api-spec) == %{version} Provides: mvn(org:elasticsearch) == %{version} Conflicts: %{prjname} %if 0%{?has_systemd} Requires(post): %fillup_prereq %else Requires(post): %insserv_prereq %fillup_prereq %endif Requires: java >= 1.8 Requires: logrotate # for sysctl: Requires: procps # for elasticsearch-plugin: Requires: hostname Requires: which # mkdir, chown in %%pre Requires(pre): coreutils %description Elasticsearch is a distributed RESTful search engine built for the cloud. Reference documentation can be found at https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html and the 'Elasticsearch: The Definitive Guide' book can be found at https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html %prep %setup -q -c -n src rm -rf /tmp/gradle* /tmp/apache* cp -RLf %{_datadir}/tetra/gradle* /tmp # local maven rm -rf ~/.m2 mkdir ~/.m2 ln -s /usr/share/tetra/m2 ~/.m2/repository rm -rf ../kit cp -Rf %{_datadir}/tetra ../kit cd %{prjname}-%{version} %patch0 -R -p1 %patch1 -p1 %patch2 -p1 cd ../.. rm -rf ~/.gradle ln -s `pwd`/kit/gradle ~/.gradle %build cd ../src/%{prjname}-%{version} export GRADLE_OPTS="-Xmx1024m" export GRADLE_USER_HOME=/tmp/gradle gradle \ --gradle-user-home $GRADLE_USER_HOME \ --project-cache-dir /tmp/gradle-cache \ --init-script %{S:1} \ -Dbuild.snapshot=false \ -Drepos.mavenLocal=true \ -xdistribution:deb:buildDeb \ -xdistribution:rpm:buildRpm \ --offline \ --no-daemon \ assemble %clean rm -rf ~/.gradle %install export BUILD_VCS_NUMBER=%{version} export NO_BRP_CHECK_BYTECODE_VERSION=true cd %{prjname}-%{version} # # bin install -d %{buildroot}%{_datadir} tar -C %{buildroot}%{_datadir} -xf distribution/tar/build/distributions/%{prjname}-%{version}.tar.gz mv %{buildroot}%{_datadir}/%{prjname}-%{version} %{buildroot}%{_datadir}/%{prjname} # handled as %%doc rm -f %{buildroot}%{_datadir}/%{prjname}/README.textile rm -f %{buildroot}%{_datadir}/%{prjname}/LICENSE.txt rm -f %{buildroot}%{_datadir}/%{prjname}/NOTICE.txt rm -f %{buildroot}%{_datadir}/%{prjname}/bin/*.exe rm -f %{buildroot}%{_datadir}/%{prjname}/bin/*.bat # # var %{__install} -d -m 755 %{buildroot}%{_localstatedir}/log/%{prjname} %{__install} -d -m 755 %{buildroot}%{_localstatedir}/lib/%{prjname} %{__install} -d -m 755 %{buildroot}%{_localstatedir}/lib/%{prjname}/data %{__install} -d -m 755 %{buildroot}%{_localstatedir}/lib/%{prjname}/work %{__install} -d -m 755 %{buildroot}%{_rundir}/%{prjname} # # /usr/share %{__install} -d %{buildroot}%{_datadir}/%{prjname} # # tmpfiles.d %{__install} -d -m 755 %{buildroot}%{_tmpfilesdir} %{__install} -m 644 %{S:5} %{buildroot}%{_tmpfilesdir}/%{prjname}.conf # # sbin %{__install} -d %{buildroot}%{_sbindir} # # init scripts / systemd %if 0%{?has_systemd} %{__install} -D -m 644 distribution/src/main/packaging/systemd/%{prjname}.service $RPM_BUILD_ROOT%{_unitdir}/%{prjname}.service %{__install} -D -m 644 distribution/src/main/packaging/systemd/sysctl/%{prjname}.conf $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/%{prjname}.conf # rc%%{prjname} ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rc%{prjname} %else mkdir -p $RPM_BUILD_ROOT%{_initddir} %{__install} -m 755 %{S:8} $RPM_BUILD_ROOT%{_initddir}/%{prjname} ln -sf %{_initddir}/%{prjname} $RPM_BUILD_ROOT%{_sbindir}/rc%{prjname} %endif # # logrotate %{__install} -D -m 644 %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/%{prjname} # # SuSEfirewall2 %{__install} -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{prjname} # # /etc/elasticsearch %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{prjname} %{__install} -m 644 distribution/src/main/resources/config/%{prjname}.yml %{buildroot}%{_sysconfdir}/%{prjname} %{__install} -m 644 distribution/src/main/resources/config/jvm.options %{buildroot}%{_sysconfdir}/%{prjname} %{__install} -m 644 distribution/src/main/resources/config/log4j2.properties %{buildroot}%{_sysconfdir}/%{prjname} %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{prjname}/scripts # # sysconfig template %{__mkdir} -p %{buildroot}%{_fillupdir} %{__install} -m 644 distribution/src/main/packaging/env/%{prjname} %{buildroot}%{_fillupdir}/sysconfig.%{prjname} %if 0%{?suse_version} > 1010 %fdupes %{buildroot}%{_datadir}/%{prjname} %endif %pre %if 0%{?has_systemd} %service_add_pre %{prjname}.service %endif ## create %%{prjname} group and user getent group %{prjname} >/dev/null || groupadd -r %{prjname} getent passwd %{prjname} >/dev/null || useradd -r -g %{prjname} -d %{_localstatedir}/lib/%{prjname} -s /sbin/nologin -c "service user for elasticsearch" %{prjname} exit 0 %post %{fillup_and_insserv -n -y %{prjname}} %service_add_post %{prjname}.service # rpm is kinda stupid ... # Create our dirs immediatly, after a manual package install. # After a reboot systemd/aaa_base will take care. %if 0%{?has_systemd} systemd-tmpfiles --create %{_tmpfilesdir}/%{prjname}.conf %else test -d %{_rundir}/%{prjname} || mkdir -m 755 %{_rundir}/%{prjname} && chown %{prjname}.%{prjname} %{_rundir}/%{prjname} %endif %preun %if 0%{?has_systemd} %service_del_preun %{prjname}.service %else %stop_on_removal %endif %postun ## no auto restart on update export DISABLE_RESTART_ON_UPDATE=1 %if 0%{?has_systemd} %service_del_postun %{prjname}.service %else %insserv_cleanup %endif # only execute in case of package removal, not on upgrade if [ $1 -eq 0 ] ; then getent passwd %{prjname} > /dev/null if [ "$?" == "0" ] ; then userdel %{prjname} fi getent group %{prjname} >/dev/null if [ "$?" == "0" ] ; then groupdel %{prjname} fi fi %files %defattr(-,root,root) %doc %{prjname}-%{version}/README.textile %doc %{prjname}-%{version}/LICENSE.txt %doc %{prjname}-%{version}/NOTICE.txt %dir %{_datadir}/%{prjname} %dir %{_sysconfdir}/%{prjname} %dir %{_sysconfdir}/%{prjname}/scripts %config(noreplace) %attr(644,root,%{prjname}) %{_sysconfdir}/%{prjname}/* %dir %{_fillupdir} %{_fillupdir}/sysconfig.%{prjname} %config %{_sysconfdir}/sysctl.d/%{prjname}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/%{prjname} %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{prjname} %dir %{_datadir}/%{prjname} %config(noreplace) %attr(644,root,%{prjname}) %{_datadir}/%{prjname}/config/* %{_datadir}/%{prjname}/* %if 0%{?has_systemd} %{_unitdir}/%{prjname}.service %{_tmpfilesdir}/%{prjname}.conf %else %attr(755,root,root) %{_initddir}/%{prjname} %exclude %{_tmpfilesdir}/%{prjname}.conf %dir %{_sysctldir} %{_sysctldir}/%{prjname}.conf %endif %{_sbindir}/rc%{prjname} %dir %attr(755,%{prjname},%{prjname}) %{_localstatedir}/lib/%{prjname} %dir %attr(755,%{prjname},%{prjname}) %{_localstatedir}/log/%{prjname} %dir %attr(755,%{prjname},%{prjname}) %{_datadir}/%{prjname}/plugins %dir %ghost %attr(755,%{prjname},%{prjname}) %{_rundir}/%{prjname} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor