Re: Status of the forge macros?

2023-05-25 Thread Ben Beasley

On 5/25/23 03:02, Panu Matilainen wrote:

On 5/24/23 18:26, Zbigniew Jędrzejewski-Szmek wrote:

Minor comment:
   %(c=%{commit}; echo ${c:0:7})
is a bit nicer because it doesn't require 'cut', it just uses 'echo',
which is a shell builtin.


Or in rpm >= 4.19 (just landed in rawhide), you can just do

%{sub %{commit} 1 8}


Both of these suggestions are really nice small improvements. Thanks!

Since this use case is in the Version field, and therefore the expansion 
is needed in the source RPMs, I will have to wait to use the RPM macro 
until my machine and the Koji builders are on rpm >=4.19. It’s still 
good to know about.


The shell-parameter-expansion suggestion takes a zero-based index and 
length[1], while the Lua routine exposed in the RPM macro takes the 
first and last one-based indices of the substring[2], so the exact 
equivalent would be:


    %{sub %{commit} 1 7}

[1] 
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html


[2] https://www.lua.org/pil/20.html
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-25 Thread Panu Matilainen

On 5/24/23 18:26, Zbigniew Jędrzejewski-Szmek wrote:

On Wed, May 24, 2023 at 11:13:15AM -0400, Ben Beasley wrote:

In your example, the forge macros simplify the spec file only because a 
snapshot is involved; but the forge macros put the snapshot info in the Release 
field, which is still permissible but deprecated[1].

Without the forge macros, the spec file would admittedly be a little more 
complex. I would probably do something like the following:

%global commit   791953030836d39687688a8e7f1a3e708892cfa1
%global snapdate 20230420

Version: 1.2^%{snapdate}git%(echo '%{commit}' | cut -b -7)
Release: 1%{?dist}


Minor comment:
   %(c=%{commit}; echo ${c:0:7})
is a bit nicer because it doesn't require 'cut', it just uses 'echo',
which is a shell builtin.


Or in rpm >= 4.19 (just landed in rawhide), you can just do

%{sub %{commit} 1 8}

There's a bunch of new macro string operations like that, see the 
related group in https://rpm-software-management.github.io/rpm/manual/macros


 :P

- Panu -
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-24 Thread PGNet Dev

If the need to package a snapshot goes away


'need' is certainly one right operative question.

whose?

Redhat's?
official Fedora packaging's?
"just us COPR users"?

i'm in the last camp.

i build/package to scratch my own projects' requirements' itch(es).

here's one, below, that depends on forge macros, making the build 
manageable/trivial

no, i don't expect this to be used by anyone else, especially not official 
packaging
but, without the ease/convenience forge macros, the cost of building here rises 
quickly

-
%{?_pgnd_macros}
%global _owner pgnd
%global _build_timestamp %( date +%%Y%%m%%d_%%H%%M%%S --utc )

%bcond_without testcondition 1

%define _ngx_namenginx
%define _ngx_comment Nginx Web Server
%define _ngx_version 1.25.0

%define _modsecurity_version 1.0.3

%define _ngx_usr wwwrun
%define _ngx_grp www

%define _ngx_prefix  /usr/local/nginx
%define _ngx_logdir  /var/log/nginx
%define _ngx_confdir /usr/local/etc/ORIG-nginx
%define _ngx_moddir  /usr/local/nginx-modules
%define _ngx_tmpdir  %{_localstatedir}/lib/nginx/tmp

%define _ngx_cc  /usr/bin/gcc
%define _ngx_cpp /usr/bin/cpp

%define _ngx_debug_flags -Wp,-D_FORTIFY_SOURCE=2

%global forgeurl0 https://github.com/nginx/nginx
Version:  %{_ngx_version}
%global tag0  release-%{version}

%global forgeurl1 https://github.com/openresty/headers-more-nginx-module
%global branch1   master

%global forgeurl4 https://github.com/leev/ngx_http_geoip2_module
%global branch4   master

%global forgeurl5 https://github.com/vision5/ngx_devel_kit
%global branch5   master

%global forgeurl8 https://github.com/google/ngx_brotli
%global branch8   master

%global forgeurl9 https://github.com/nginx/njs
%global branch9   master

%global forgeurl11 https://github.com/GetPageSpeed/ngx_security_headers
%global branch11   master

%global forgeurl12 https://github.com/nulab/nginx-length-hiding-filter-module
%global branch12   master

%global forgeurl13 https://github.com/GetPageSpeed/ngx_immutable
%global branch13   master

%global forgeurl14 https://github.com/SpiderLabs/ModSecurity-nginx
%global tag14  v%{_modsecurity_version}

%forgemeta -i -a
%global dist .%{_owner}_%{_build_timestamp}.fc%{fedora}

Name:  %{_ngx_name}
Release:   0%{?dist}
Summary:   %{_ngx_comment}
License:   BSD-2-Clause

URL:   %{forgeurl0}
Source0:   %{forgesource0}
Source1:   %{forgesource1}
Source4:   %{forgesource4}
Source5:   %{forgesource5}
Source8:   %{forgesource8}
Source9:   %{forgesource9}
Source11:  %{forgesource11}
Source12:  %{forgesource12}
Source13:  %{forgesource13}
Source14:  %{forgesource14}

Source100: https://nginx.org/en/CHANGES
Source101: https://nginx.org/LICENSE

BuildRequires: brotli-devel
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: gd-devel
BuildRequires: git
BuildRequires: grep
BuildRequires: gnupg2
BuildRequires: libatomic_ops-devel
BuildRequires: libmaxminddb-devel
BuildRequires: libmodsecurity-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: make

BuildRequires: openssl-devel
BuildRequires: pcre2-devel
BuildRequires: perl-ExtUtils-Embed
BuildRequires: perl-generators
BuildRequires: pkgconf-pkg-config
BuildRequires: zlib-devel

Requires:  nginx-filesystem
Requires:  libmodsecurity
Requires:  mod_security_crs
Requires:  openssl
Requires:  pcre2

BuildRequires: systemd
Requires(post):systemd
Requires(preun):   systemd
Requires(postun):  systemd

Provides:  webserver
Conflicts: nginx-core
Conflicts: nginx-mimetypes
Obsoletes: nginx< %{_ngx_version}
Obsoletes: nginx-filesystem < %{_ngx_version}

%description
%{_ngx_comment}

%package filesystem
Summary:   nginx directory layout
BuildArch: noarch
Requires(pre): shadow-utils

%description filesystem
nginx directory layout
dummy, to satisfy php-fpm reqt and prevent pulling distro pkg


%prep
%forgesetup -a
cp %{SOURCE100} %{SOURCE101} .

%build
export CFLAGS="%{_CFLAGS}   -Wno-dangling-pointer"
export CPPFLAGS="%{_CFLAGS} -Wno-dangling-pointer"
export CXXFLAGS="%{_CFLAGS} -Wno-dangling-pointer"
export LDFLAGS="%{_LDFLAGS} -Wno-dangling-pointer"

export DESTDIR=%{buildroot}
cd %{_builddir}/%{name}-%{tag0}
export LUAJIT_LIB=""
export LUAJIT_INC=""
./auto/configure \
--with-debug \
--build="PGNd Custom Build" \
--user=%{_ngx_usr} --group=%{_ngx_grp} \
--prefix=%{_ngx_prefix} \
 --conf-path=%{_ngx_confdir}/nginx.conf \
 --error-log-path=%{_ngx_logdir}/main.error.log \
 --http-log-path=%{_ngx_logdir}/main.access.log \
 --modules-path=%{_ngx_moddir} \
  --http-client-body-temp-path=%{_ngx_tmpdir}/client_body \
  --http-proxy-temp-path=%{_ngx_tmpdir}/proxy \
  

Re: Status of the forge macros?

2023-05-24 Thread Zbigniew Jędrzejewski-Szmek
On Wed, May 24, 2023 at 11:13:15AM -0400, Ben Beasley wrote:
> In your example, the forge macros simplify the spec file only because a 
> snapshot is involved; but the forge macros put the snapshot info in the 
> Release field, which is still permissible but deprecated[1].
> 
> Without the forge macros, the spec file would admittedly be a little more 
> complex. I would probably do something like the following:
> 
> %global commit   791953030836d39687688a8e7f1a3e708892cfa1
> %global snapdate 20230420
> 
> Version: 1.2^%{snapdate}git%(echo '%{commit}' | cut -b -7)
> Release: 1%{?dist}

Minor comment:
  %(c=%{commit}; echo ${c:0:7})
is a bit nicer because it doesn't require 'cut', it just uses 'echo',
which is a shell builtin.

Zbyszek
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-24 Thread Ben Beasley
In your example, the forge macros simplify the spec file only because a 
snapshot is involved; but the forge macros put the snapshot info in the Release 
field, which is still permissible but deprecated[1].

Without the forge macros, the spec file would admittedly be a little more 
complex. I would probably do something like the following:

%global commit   791953030836d39687688a8e7f1a3e708892cfa1
%global snapdate 20230420

Version: 1.2^%{snapdate}git%(echo '%{commit}' | cut -b -7)
Release: 1%{?dist}

URL: https://github.com/riscv/opensbi
Source: %{url}/archive/%{commit}/opensbi-%{commit}.tar.gz

%prep
%autosetup -n opensbi-%{commit}

If the need to package a snapshot goes away, then the utility of the forge 
macros does too, as the packaging without them is perhaps even simpler than 
wirh them:

Version: 1.2.12345
Release: 1%{?dist}

URL: https://github.com/riscv/opensbi
Source: %{url}/archive/v%{version}/opensbi-%{version}.tar.gz

%prep
%autosetup

[1] 
https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#traditional-versioning

On Wed, May 24, 2023, at 9:32 AM, Richard W.M. Jones wrote:
> On Wed, May 24, 2023 at 09:56:30AM +0200, Vitaly Zaitsev via devel wrote:
>> On 23/05/2023 19:27, Richard W.M. Jones wrote:
>> >... so today I was taking part in a package review which uses these
>> >macros and was surprised to be told that they are deprecated.
>> 
>> Their author left Fedora a few years ago. They're now unmaintained
>> and may be removed soon (see FPC ticket[1]).
>> 
>> [1]: https://pagure.io/packaging-committee/pull-request/1270
>
> So the issue for me is I'm considering a new package (opensbi).  It is
> greatly(?) simplified by using the forge macros.  Nothing in official
> documentation says that new packages shouldn't use the forge macros,
> although the link above would add such a statement.  There seems to be
> disagreement in this thread about the best way forwards.
>
> Proposed spec:
> http://git.annexia.org/?p=fedora-reviews.git;a=blob;f=opensbi/opensbi.spec
>
> Rich.
>
> -- 
> Richard Jones, Virtualization Group, Red Hat 
> http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> Fedora Windows cross-compiler. Compile Windows programs, test, and
> build Windows installers. Over 100 libraries supported.
> http://fedoraproject.org/wiki/MinGW
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> Do not reply to spam, report it: 
> https://pagure.io/fedora-infrastructure/new_issue
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-24 Thread Richard W.M. Jones
On Wed, May 24, 2023 at 09:56:30AM +0200, Vitaly Zaitsev via devel wrote:
> On 23/05/2023 19:27, Richard W.M. Jones wrote:
> >... so today I was taking part in a package review which uses these
> >macros and was surprised to be told that they are deprecated.
> 
> Their author left Fedora a few years ago. They're now unmaintained
> and may be removed soon (see FPC ticket[1]).
> 
> [1]: https://pagure.io/packaging-committee/pull-request/1270

So the issue for me is I'm considering a new package (opensbi).  It is
greatly(?) simplified by using the forge macros.  Nothing in official
documentation says that new packages shouldn't use the forge macros,
although the link above would add such a statement.  There seems to be
disagreement in this thread about the best way forwards.

Proposed spec:
http://git.annexia.org/?p=fedora-reviews.git;a=blob;f=opensbi/opensbi.spec

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-24 Thread Sandro

On 24-05-2023 09:56, Vitaly Zaitsev via devel wrote:

On 23/05/2023 19:27, Richard W.M. Jones wrote:

... so today I was taking part in a package review which uses these
macros and was surprised to be told that they are deprecated.


Their author left Fedora a few years ago. They're now unmaintained and 
may be removed soon (see FPC ticket[1]).


[1]: https://pagure.io/packaging-committee/pull-request/1270



I don't infer a removal request from the ticket's title: "SourceURL: 
document that the forge macros are deprecated / unmaintained".


Yes, it should be mentioned that they are currently unmaintained. I, for 
one, am a happy user of the forge macros and would like to keep using 
them. I probably started using them seeing examples, that did not have a 
deprecation warning.


As mentioned in the ticket above and the PR [1] linked, separating the 
forge macros from redhat-rpm-config, may be the way forward. @gotmax23 
already provided a PoC. I'd be willing to help out making this happen. 
That said, my knowledge of RPM macros is limited.


[1] https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/248

-- Sandro
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-24 Thread Vitaly Zaitsev via devel

On 23/05/2023 19:27, Richard W.M. Jones wrote:

... so today I was taking part in a package review which uses these
macros and was surprised to be told that they are deprecated.


Their author left Fedora a few years ago. They're now unmaintained and 
may be removed soon (see FPC ticket[1]).


[1]: https://pagure.io/packaging-committee/pull-request/1270

--
Sincerely,
  Vitaly Zaitsev (vit...@easycoding.org)
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-23 Thread PGNet Dev


 Original Message 
From: Richard W.M. Jones [mailto:rjo...@redhat.com]
Sent: Tuesday, May 23, 2023 at 1:27 PM EDT
To: devel@lists.fedoraproject.org
Subject: Status of the forge macros?



I've been using the so-called forge macros in lots of packages:

https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_using_forges_hosted_revision_control

... so today I was taking part in a package review which uses these
macros and was surprised to be told that they are deprecated.


m_oO_m ?!


Is this true, and if so can we actually document that?  Else
un-deprecate them as they are really useful.


+1 to that.  been similarly using them for ages, particularly given the i've 
been often pointed to the d.f.o link above as current :-/

imo, immensely useful, with unique capabilities (tho, similar to OBS) for forge 
src mgmt.

___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Status of the forge macros?

2023-05-23 Thread Miro Hrončok

On 23. 05. 23 19:27, Richard W.M. Jones wrote:


I've been using the so-called forge macros in lots of packages:

https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_using_forges_hosted_revision_control

... so today I was taking part in a package review which uses these
macros and was surprised to be told that they are deprecated.

Is this true, and if so can we actually document that?  Else
un-deprecate them as they are really useful.


I'd say unmaintained rather than deprecated.
See https://pagure.io/packaging-committee/pull-request/1270

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Status of the forge macros?

2023-05-23 Thread Richard W.M. Jones

I've been using the so-called forge macros in lots of packages:

https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_using_forges_hosted_revision_control

... so today I was taking part in a package review which uses these
macros and was surprised to be told that they are deprecated.

Is this true, and if so can we actually document that?  Else
un-deprecate them as they are really useful.

Rich.


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue