]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-dev-build: create ceph-release configuration and build steps 429/head
authorAlfredo Deza <adeza@redhat.com>
Fri, 12 Aug 2016 13:19:01 +0000 (09:19 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 12 Aug 2016 13:19:01 +0000 (09:19 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-dev-build/build/build_rpm

index e42edfae76eb43d88f80aa92bd45c7194694f580..52f7a17737b1185aee400b0d8aa43e8f62ed165e 100644 (file)
@@ -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 <<EOF > ${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 <adeza@redhat.com> 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 <<EOF > $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"