maintainer: Build Fedora package in copr.
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 18 Jan 2020 14:53:14 +0000 (14:53 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 18 Jan 2020 15:31:13 +0000 (15:31 +0000)
.gitignore
Goalfile.in
Makefile.in
configure.ac
goals.spec.in [new file with mode: 0644]

index 1a724bb..dcf5b7a 100644 (file)
@@ -24,6 +24,8 @@ Makefile
 /config.h.in
 /config.log
 /config.status
+/goals.spec
+/goals-*.src.rpm
 /install-sh
 /run
 /src/config.ml
index e8d6018..361dd07 100644 (file)
@@ -176,10 +176,10 @@ goal install = {
     # exec_prefix die die die
     bindir="@prefix@/bin"
     datadir="@prefix@/share"
-    mkdir -p %DESTDIR/"$bindir"
-    mkdir -p %DESTDIR/"$datadir/goals"
-    install src/goals %DESTDIR/"$bindir" -m 0755
-    install %stdlibfiles %DESTDIR/"$datadir"/goals -m 644
+    mkdir -p %DESTDIR"$bindir"
+    mkdir -p %DESTDIR"$datadir/goals"
+    install src/goals %DESTDIR"$bindir" -m 0755
+    install %stdlibfiles %DESTDIR"$datadir"/goals -m 644
 }
 
 #----------------------------------------------------------------------
@@ -223,6 +223,7 @@ let distfiles = [
     "configure",
     "configure.ac",
     wildcard ("docs/*.pod"),
+    "goals.spec.in",
     "install-sh",
     "m4/ocaml.m4",
     "run.in",
@@ -290,12 +291,14 @@ goal maintainer-check-extra-dist = : dist @{
 goal maintainer-release = : dist,
                             maintainer-check-extra-dist,
                             distcheck,
-                            maintainer-upload
+                            maintainer-upload,
+                            maintainer-srpm,
+                            maintainer-fedora-copr
 
 let websitedir = "%HOME/d/websites/people.redhat.com/goals"
 
 # XXX Should actually use the *url tactic here.
-goal maintainer-upload = {
+goal maintainer-upload = : distcheck {
     [ -d %websitedir ]
     cp %tarfile %websitedir/files
     cp README %websitedir/README
@@ -306,3 +309,21 @@ goal maintainer-upload = {
     cd ..
     ./.rsync
 }
+
+pure function get-fedora-dist () returning string = @{
+    rpm --eval '%%dist'
+}
+let fedora-dist = get-fedora-dist ()
+let srpm = "goals-@PACKAGE_VERSION@%fedora-dist.src.rpm"
+
+goal maintainer-srpm =
+"%srpm" : tarfile, "goals.spec" {
+    rpmbuild -bs \
+        --define "%%_sourcedir $PWD" \
+        --define "%%_srcrpmdir $PWD" \
+        goals.spec
+}
+
+goal maintainer-fedora-copr = : maintainer-upload, srpm {
+    copr build rjones/goals %srpm
+}
\ No newline at end of file
index 7b110fc..eeded2e 100644 (file)
@@ -19,8 +19,9 @@
 # Pass through normal targets to Goalfile.in
 
 all clean depend install check maintainer-clean dist distcheck \
-maintainer-check-extra-dist maintainer-release: src/goals
-       @./run src/goals $@
+maintainer-check-extra-dist maintainer-release \
+maintainer-srpm maintainer-fedora-copr: src/goals
+       @./run src/goals $@ 'DESTDIR="$(DESTDIR)"'
 
 # If src/goals doesn't exist then brute-force build it.  Once we have
 # src/goals we can rebuild it and other parts of the project using
index 380a734..b9b89bc 100644 (file)
@@ -70,6 +70,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 AC_CONFIG_FILES([run], [chmod +x,-w run])
 AC_CONFIG_FILES([Goalfile Makefile
+                 goals.spec
                  src/config.ml])
 
 AC_OUTPUT
diff --git a/goals.spec.in b/goals.spec.in
new file mode 100644 (file)
index 0000000..d77af16
--- /dev/null
@@ -0,0 +1,56 @@
+Name:           @PACKAGE_NAME@
+Version:        @PACKAGE_VERSION@
+Release:        1%{?dist}
+Summary:        An experimental tool that generalizes "make"
+
+License:        GPLv2+
+URL:            https://people.redhat.com/~rjones/goals/
+
+Source0:        https://people.redhat.com/~rjones/goals/files/%{name}-%{version}.tar.gz
+
+BuildRequires:  ocaml
+BuildRequires:  ocaml-findlib
+BuildRequires:  ocaml-menhir
+BuildRequires:  perl-podlators
+
+
+%description
+Make is a clever tool for expressing dependencies between files and it
+is widely used for building software.  But it has some limitations.
+It only knows about files.  It has limited ways to write rules.  And
+for a tool whose main job is running shell commands, there are several
+gotchas when you actually write shell commands.
+
+Goals is an experimental tool which aims to generalize make beyond
+these limitations.
+
+
+%prep
+%autosetup -p1
+
+
+%build
+%configure
+make %{?_smp_mflags}
+
+
+%install
+%make_install
+
+
+%check
+make %{?_smp_mflags} check
+
+
+%files
+%doc README TODO
+%license COPYING
+%{_bindir}/goals
+%dir %{_datadir}/goals
+%{_datadir}/goals/*.gl
+%{_datadir}/goals/*.sh
+
+
+%changelog
+* Sat Jan 18 2020 Richard W.M. Jones <rjones@redhat.com> - %{version}-1
+- Version %{version}.