~witcher/rss-email-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
7 2

[PATCH 1/2] Add a makefile

Details
Message ID
<20230812230238.26064-1-hugo@whynothugo.nl>
DKIM signature
missing
Download raw message
Patch: +23 -0
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

[PATCH 2/2] Use the makefile in CI

Details
Message ID
<20230812230238.26064-3-hugo@whynothugo.nl>
In-Reply-To
<20230812230238.26064-1-hugo@whynothugo.nl> (view parent)
DKIM signature
missing
Download raw message
Patch: +7 -1
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
Details
Message ID
<CUR88B0BUFV1.1JT8VCC12QZJ1@navi>
In-Reply-To
<20230812230238.26064-1-hugo@whynothugo.nl> (view parent)
DKIM signature
missing
Download raw message
Hi Hugo, it's always great to see you contribute :)

On Sun Aug 13, 2023 at 1:02 AM CEST, Hugo Osvaldo Barrera wrote:
> +.PHONY: build
> +build: target/release/rss-email rss-email.1 rss-email.5
I'd rather have a separate `doc` rule that (optionally) builds the documentation
with scdoc, but seeing as it's standard to build documentation on invoking
`make` it's probably better to instead not mark scdoc as an optional dependency.
Can you remove the "optional" marker for scdoc in the README?

> +.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
`rss-email.5` needs to go to `${DESTDIR}${PREFIX}/share/man/man5`.

> +	@install -Dm644 LICENSE 	${DESTDIR}${PREFIX}/share/licenses/rss-email/LICENSE
`${PREFIX}/share/licenses` is the license directory on Alpine and Arch, for
example, but Debian expects the dep5 copyright file in
`${PREFIX}/share/doc/${PACKAGE}` without any original LICENSE file installed
anywhere.
Because of this the LICENSE ideally shouldn't be installed in the `install`
step and installation of it to the correct place (and in the correct format)
should be left to downstream IMO. Your opinion on this is appreciated, though!

Thank you for your contribution!

-- 
witcher

Re: [PATCH 2/2] Use the makefile in CI

Details
Message ID
<CUR901N3WUTQ.1MACKJOPHOAOI@navi>
In-Reply-To
<20230812230238.26064-3-hugo@whynothugo.nl> (view parent)
DKIM signature
missing
Download raw message
On Sun Aug 13, 2023 at 1:02 AM CEST, Hugo Osvaldo Barrera wrote:
> 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: |
Typo: "installl" :)
> +      cd rss-email
> +      sudo make install
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!

-- 
witcher

[PATCH v2 1/2] Add a makefile

Details
Message ID
<20230816145653.1004-2-hugo@whynothugo.nl>
In-Reply-To
<CUR88B0BUFV1.1JT8VCC12QZJ1@navi> (view parent)
DKIM signature
missing
Download raw message
Patch: +24 -1
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
Details
Message ID
<4a60e8d6-46ae-4f10-b669-942ba6bb4274@app.fastmail.com>
In-Reply-To
<CUR88B0BUFV1.1JT8VCC12QZJ1@navi> (view parent)
DKIM signature
missing
Download raw message
On Sun, 13 Aug 2023, at 09:50, witcher wrote:
> [...]
> `${PREFIX}/share/licenses` is the license directory on Alpine and Arch, for
> example, but Debian expects the dep5 copyright file in
> `${PREFIX}/share/doc/${PACKAGE}` without any original LICENSE file installed
> anywhere.
> Because of this the LICENSE ideally shouldn't be installed in the `install`
> step and installation of it to the correct place (and in the correct format)
> should be left to downstream IMO. Your opinion on this is appreciated, though!
>
> Thank you for your contribution!
>
> -- 
> witcher
>

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 :)

-- 
Hugo

Re: [PATCH v2 1/2] Add a makefile

Details
Message ID
<CUYFEG9TOPLF.6ORECLOT9KOB@portable-navi>
In-Reply-To
<20230816145653.1004-2-hugo@whynothugo.nl> (view parent)
DKIM signature
missing
Download raw message
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!

-- 
witcher

Re: [PATCH v2 1/2] Add a makefile

Details
Message ID
<mshj64a3wsiys3camrltbvsau2qzhsbvhm56xpwewcaemqjm4h@jt23vng35m3u>
In-Reply-To
<CUYFEG9TOPLF.6ORECLOT9KOB@portable-navi> (view parent)
DKIM signature
missing
Download raw message
On 2023-08-21 20:56, witcher wrote:
> 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!
> 
> -- 
> witcher

No objections on my behalf, thanks for giving it the final polish.

Cheers,

-- 
Hugo
Reply to thread Export thread (mbox)