From: Alfredo Deza Date: Fri, 12 Aug 2016 13:19:01 +0000 (-0400) Subject: ceph-dev-build: create ceph-release configuration and build steps X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=22c8ee325665701297a838818ff7f40f336dc150;p=ceph-build.git ceph-dev-build: create ceph-release configuration and build steps Signed-off-by: Alfredo Deza --- diff --git a/ceph-dev-build/build/build_rpm b/ceph-dev-build/build/build_rpm index e42edfae..52f7a177 100644 --- a/ceph-dev-build/build/build_rpm +++ b/ceph-dev-build/build/build_rpm @@ -60,6 +60,7 @@ echo dist $dist vers=`cat ./dist/version` chacra_ref="$BRANCH" +# FIXME: this needs flavor support chacra_endpoint="ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}" chacra_check_url="${chacra_endpoint}/${ARCH}/librados2-${vers}-0.${DIST}.${ARCH}.rpm" @@ -112,7 +113,110 @@ BUILDAREA=`readlink -fn ${BUILDAREA}` ### rpm wants absolute path cd ${BUILDAREA}/SPECS rpmbuild -ba --define "_topdir ${BUILDAREA}" ceph.spec -echo done +# The following was copied from autobuild-ceph/build-ceph-rpm.sh +# which creates the ceph-release rpm meant to create the repository file for the repo +# that will be built and served later. +# Create and build an RPM for the repository + +# FIXME: this needs flavor support +cat < ${BUILDAREA}/SPECS/ceph-release.spec +Name: ceph-release +Version: 1 +Release: 0%{?dist} +Summary: Ceph Development repository configuration +Group: System Environment/Base +License: GPLv2 +URL: $chacra_url/r/ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}/ +Source0: ceph.repo +#Source0: RPM-GPG-KEY-CEPH +#Source1: ceph.repo +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +%description +This package contains the Ceph repository GPG key as well as configuration +for yum and up2date. + +%prep + +%setup -q -c -T +install -pm 644 %{SOURCE0} . +#install -pm 644 %{SOURCE1} . + +%build + +%install +rm -rf %{buildroot} +#install -Dpm 644 %{SOURCE0} \ +# %{buildroot}/%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-CEPH +%if 0%{defined suse_version} +install -dm 755 %{buildroot}/%{_sysconfdir}/zypp +install -dm 755 %{buildroot}/%{_sysconfdir}/zypp/repos.d +install -pm 644 %{SOURCE0} \ + %{buildroot}/%{_sysconfdir}/zypp/repos.d +%else +install -dm 755 %{buildroot}/%{_sysconfdir}/yum.repos.d +install -pm 644 %{SOURCE0} \ + %{buildroot}/%{_sysconfdir}/yum.repos.d +%endif + +%clean +#rm -rf %{buildroot} + +%post + +%postun + +%files +%defattr(-,root,root,-) +#%doc GPL +%if 0%{defined suse_version} +/etc/zypp/repos.d/* +%else +/etc/yum.repos.d/* +%endif +#/etc/pki/rpm-gpg/* + +%changelog +* Fri Aug 12 2016 Alfredo Deza 1-1 +- Initial Package +EOF +# End of ceph-release.spec file. + +# GPG Key +#gpg --export --armor $keyid > ${BUILDAREA}/SOURCES/RPM-GPG-KEY-CEPH +#chmod 644 ${BUILDAREA}/SOURCES/RPM-GPG-KEY-CEPH + +# Install ceph.repo file +cat < $BUILDAREA/SOURCES/ceph.repo +[Ceph] +name=Ceph packages for \$basearch +baseurl=$chacra_url/r/ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}/\$basearch +enabled=1 +gpgcheck=0 +type=rpm-md +gpgkey=https://download.ceph.com/keys/autobuild.asc + +[Ceph-noarch] +name=Ceph noarch packages +baseurl=$chacra_url/r/ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}/noarch +enabled=1 +gpgcheck=0 +type=rpm-md +gpgkey=https://download.ceph.com/keys/autobuild.asc + +[ceph-source] +name=Ceph source packages +baseurl=$chacra_url/r/ceph/${chacra_ref}/${SHA1}/${DISTRO}/${RELEASE}/SRPMS +enabled=1 +gpgcheck=0 +type=rpm-md +gpgkey=https://download.ceph.com/keys/autobuild.asc +EOF +# End of ceph.repo file + +rpmbuild -bb --define "_topdir ${BUILDAREA}" ${BUILDAREA}/SPECS/ceph-release.spec + # Make sure we execute at the top level directory cd "$WORKSPACE"