~witcher/rss-email-devel

Hugo Osvaldo Barrera: 3
 Add a makefile
 Add a makefile
 Use the makefile in CI

 4 files changed, 54 insertions(+), 2 deletions(-)
Can you install this to a local directory with `DESTDIR` and use `tree` to
display the result in CI? Otherwise subtle mistakes can't be spotted in a CI
run.

Thank you again!
Next
Oh, I forgot to reply to this last item.

I'm not sure what's best. Either we can drop installing the licence (and
require that downstream always handles it themselves), or we can leave it
as-is (which helps some distros, but others have to move it elsewhere).

I'll leave that up to you :)
Hi Hugo,

before applying your patches, I went ahead and corrected your commits to avoid
another round of patches for these trivial changes. I hope you don't mind.

Thank you for your contribution and maintaining the package for it for Alpine!
No objections on my behalf, thanks for giving it the final polish.

Cheers,
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~witcher/rss-email-devel/patches/43542/mbox | git am -3
Learn more about email & git

[PATCH 1/2] Add a makefile Export this patch

This is usable by downstream distributions so that they don't each need
to re-write these bits.
---
 Makefile | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6f7a844
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
DESTDIR?=/
PREFIX=/usr

rss-email.1: docs/rss-email.1.scd
	scdoc < docs/rss-email.1.scd > rss-email.1

rss-email.5: docs/rss-email.5.scd
	scdoc < docs/rss-email.5.scd > rss-email.5

target/release/rss-email:
	cargo build --release --locked

.PHONY: build
build: target/release/rss-email rss-email.1 rss-email.5

.PHONY: install
install: build
	@install -Dm755 target/release/rss-email 	${DESTDIR}${PREFIX}/bin/rss-email
	@install -Dm644 rss-email.1	${DESTDIR}${PREFIX}/share/man/man1/rss-email.1
	@install -Dm644 rss-email.5	${DESTDIR}${PREFIX}/share/man/man1/rss-email.5
	@install -Dm644 LICENSE 	${DESTDIR}${PREFIX}/share/licenses/rss-email/LICENSE
	@install -Dm644 README.md 	${DESTDIR}${PREFIX}/share/doc/rss-email/README.md
	@install -Dm644 config.example.toml 	${DESTDIR}${PREFIX}/share/rss-email/config.toml
-- 
2.41.0
Hi Hugo, it's always great to see you contribute :)

[PATCH v2 1/2] Add a makefile Export this patch

This is usable by downstream distributions so that they don't each need
to re-write these bits.
---
 Makefile  | 23 +++++++++++++++++++++++
 README.md |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6f7a844
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,23 @@
DESTDIR?=/
PREFIX=/usr

rss-email.1: docs/rss-email.1.scd
	scdoc < docs/rss-email.1.scd > rss-email.1

rss-email.5: docs/rss-email.5.scd
	scdoc < docs/rss-email.5.scd > rss-email.5

target/release/rss-email:
	cargo build --release --locked

.PHONY: build
build: target/release/rss-email rss-email.1 rss-email.5

.PHONY: install
install: build
	@install -Dm755 target/release/rss-email 	${DESTDIR}${PREFIX}/bin/rss-email
	@install -Dm644 rss-email.1	${DESTDIR}${PREFIX}/share/man/man1/rss-email.1
	@install -Dm644 rss-email.5	${DESTDIR}${PREFIX}/share/man/man1/rss-email.5
	@install -Dm644 LICENSE 	${DESTDIR}${PREFIX}/share/licenses/rss-email/LICENSE
	@install -Dm644 README.md 	${DESTDIR}${PREFIX}/share/doc/rss-email/README.md
	@install -Dm644 config.example.toml 	${DESTDIR}${PREFIX}/share/rss-email/config.toml
diff --git a/README.md b/README.md
index af1fd28..e8d3191 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ Install the dependencies:
- sqlite
- [sqlx-cli](https://github.com/launchbadge/sqlx/tree/main/sqlx-cli#install)
  (optional, only for development)
- scdoc (optional)
- scdoc

First specify the `DATABASE_URL` environment variable and set up the database
with `cargo-sqlx`:
-- 
2.41.0
Hi Hugo,

before applying your patches, I went ahead and corrected your commits to avoid
another round of patches for these trivial changes. I hope you don't mind.

Thank you for your contribution and maintaining the package for it for Alpine!

[PATCH 2/2] Use the makefile in CI Export this patch

So it gets properly tested.
---
Tested here: https://builds.sr.ht/~whynothugo/job/1040484
 .build.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.build.yml b/.build.yml
index 400b19a..0b4856f 100644
--- a/.build.yml
+++ b/.build.yml
@@ -5,6 +5,7 @@ triggers:
    to: witcher <witcher@wiredspace.de>
packages:
  - rust
  - scdoc
sources:
  - https://git.sr.ht/~witcher/rss-email
tasks:
@@ -19,4 +20,9 @@ tasks:
      cargo clippy --frozen -- -D warnings
  - build: |
      cd rss-email
      cargo build --frozen
      # Building with --release is slow and pointless here.
      sed -i -e 's/--release //' -e 's/release/debug/' Makefile
      make build
  - installl: |
      cd rss-email
      sudo make install
-- 
2.41.0
Can you install this to a local directory with `DESTDIR` and use `tree` to
display the result in CI? Otherwise subtle mistakes can't be spotted in a CI
run.

Thank you again!