Skip to content

Commit 8f9164d

Browse files
committed
Packaging improvements
1 parent dbed1e7 commit 8f9164d

File tree

8 files changed

+148
-127
lines changed

8 files changed

+148
-127
lines changed

LICENSE

Lines changed: 111 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This software is copyright (c) 2020-2022 by Timothy Legge and Wesley Schwengle.
1+
This software is copyright (c) 2020-2023 by Timothy Legge and Wesley Schwengle.
22

33
This is free software; you can redistribute it and/or modify it under
44
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
1212

1313
--- The GNU General Public License, Version 1, February 1989 ---
1414

15-
This software is Copyright (c) 2020-2022 by Timothy Legge and Wesley Schwengle.
15+
This software is Copyright (c) 2020-2023 by Timothy Legge and Wesley Schwengle.
1616

1717
This is free software, licensed under:
1818

@@ -270,110 +270,143 @@ necessary. Here a sample; alter the names:
270270
That's all there is to it!
271271

272272

273-
--- The Artistic License 1.0 ---
273+
--- The Perl Artistic License 1.0 ---
274274

275-
This software is Copyright (c) 2020-2022 by Timothy Legge and Wesley Schwengle.
275+
This software is Copyright (c) 2020-2023 by Timothy Legge and Wesley Schwengle.
276276

277277
This is free software, licensed under:
278278

279-
The Artistic License 1.0
279+
The Perl Artistic License 1.0
280280

281-
The Artistic License
282281

283-
Preamble
284282

285-
The intent of this document is to state the conditions under which a Package
286-
may be copied, such that the Copyright Holder maintains some semblance of
287-
artistic control over the development of the package, while giving the users of
288-
the package the right to use and distribute the Package in a more-or-less
289-
customary fashion, plus the right to make reasonable modifications.
283+
284+
285+
The "Artistic License"
286+
287+
Preamble
288+
289+
The intent of this document is to state the conditions under which a
290+
Package may be copied, such that the Copyright Holder maintains some
291+
semblance of artistic control over the development of the package,
292+
while giving the users of the package the right to use and distribute
293+
the Package in a more-or-less customary fashion, plus the right to make
294+
reasonable modifications.
290295

291296
Definitions:
292297

293-
- "Package" refers to the collection of files distributed by the Copyright
294-
Holder, and derivatives of that collection of files created through
295-
textual modification.
296-
- "Standard Version" refers to such a Package if it has not been modified,
297-
or has been modified in accordance with the wishes of the Copyright
298-
Holder.
299-
- "Copyright Holder" is whoever is named in the copyright or copyrights for
300-
the package.
301-
- "You" is you, if you're thinking about copying or distributing this Package.
302-
- "Reasonable copying fee" is whatever you can justify on the basis of media
303-
cost, duplication charges, time of people involved, and so on. (You will
304-
not be required to justify it to the Copyright Holder, but only to the
305-
computing community at large as a market that must bear the fee.)
306-
- "Freely Available" means that no fee is charged for the item itself, though
307-
there may be fees involved in handling the item. It also means that
308-
recipients of the item may redistribute it under the same conditions they
309-
received it.
298+
"Package" refers to the collection of files distributed by the
299+
Copyright Holder, and derivatives of that collection of files
300+
created through textual modification.
301+
302+
"Standard Version" refers to such a Package if it has not been
303+
modified, or has been modified in accordance with the wishes
304+
of the Copyright Holder as specified below.
305+
306+
"Copyright Holder" is whoever is named in the copyright or
307+
copyrights for the package.
308+
309+
"You" is you, if you're thinking about copying or distributing
310+
this Package.
311+
312+
"Reasonable copying fee" is whatever you can justify on the
313+
basis of media cost, duplication charges, time of people involved,
314+
and so on. (You will not be required to justify it to the
315+
Copyright Holder, but only to the computing community at large
316+
as a market that must bear the fee.)
317+
318+
"Freely Available" means that no fee is charged for the item
319+
itself, though there may be fees involved in handling the item.
320+
It also means that recipients of the item may redistribute it
321+
under the same conditions they received it.
310322

311323
1. You may make and give away verbatim copies of the source form of the
312324
Standard Version of this Package without restriction, provided that you
313325
duplicate all of the original copyright notices and associated disclaimers.
314326

315-
2. You may apply bug fixes, portability fixes and other modifications derived
316-
from the Public Domain or from the Copyright Holder. A Package modified in such
317-
a way shall still be considered the Standard Version.
327+
2. You may apply bug fixes, portability fixes and other modifications
328+
derived from the Public Domain or from the Copyright Holder. A Package
329+
modified in such a way shall still be considered the Standard Version.
318330

319-
3. You may otherwise modify your copy of this Package in any way, provided that
320-
you insert a prominent notice in each changed file stating how and when you
321-
changed that file, and provided that you do at least ONE of the following:
331+
3. You may otherwise modify your copy of this Package in any way, provided
332+
that you insert a prominent notice in each changed file stating how and
333+
when you changed that file, and provided that you do at least ONE of the
334+
following:
322335

323-
a) place your modifications in the Public Domain or otherwise make them
324-
Freely Available, such as by posting said modifications to Usenet or an
325-
equivalent medium, or placing the modifications on a major archive site
326-
such as ftp.uu.net, or by allowing the Copyright Holder to include your
327-
modifications in the Standard Version of the Package.
336+
a) place your modifications in the Public Domain or otherwise make them
337+
Freely Available, such as by posting said modifications to Usenet or
338+
an equivalent medium, or placing the modifications on a major archive
339+
site such as uunet.uu.net, or by allowing the Copyright Holder to include
340+
your modifications in the Standard Version of the Package.
328341

329-
b) use the modified Package only within your corporation or organization.
342+
b) use the modified Package only within your corporation or organization.
330343

331-
c) rename any non-standard executables so the names do not conflict with
332-
standard executables, which must also be provided, and provide a separate
333-
manual page for each non-standard executable that clearly documents how it
334-
differs from the Standard Version.
344+
c) rename any non-standard executables so the names do not conflict
345+
with standard executables, which must also be provided, and provide
346+
a separate manual page for each non-standard executable that clearly
347+
documents how it differs from the Standard Version.
335348

336-
d) make other distribution arrangements with the Copyright Holder.
349+
d) make other distribution arrangements with the Copyright Holder.
337350

338-
4. You may distribute the programs of this Package in object code or executable
339-
form, provided that you do at least ONE of the following:
351+
4. You may distribute the programs of this Package in object code or
352+
executable form, provided that you do at least ONE of the following:
340353

341-
a) distribute a Standard Version of the executables and library files,
342-
together with instructions (in the manual page or equivalent) on where to
343-
get the Standard Version.
354+
a) distribute a Standard Version of the executables and library files,
355+
together with instructions (in the manual page or equivalent) on where
356+
to get the Standard Version.
344357

345-
b) accompany the distribution with the machine-readable source of the Package
346-
with your modifications.
358+
b) accompany the distribution with the machine-readable source of
359+
the Package with your modifications.
347360

348-
c) accompany any non-standard executables with their corresponding Standard
349-
Version executables, giving the non-standard executables non-standard
350-
names, and clearly documenting the differences in manual pages (or
351-
equivalent), together with instructions on where to get the Standard
352-
Version.
361+
c) give non-standard executables non-standard names, and clearly
362+
document the differences in manual pages (or equivalent), together
363+
with instructions on where to get the Standard Version.
353364

354-
d) make other distribution arrangements with the Copyright Holder.
365+
d) make other distribution arrangements with the Copyright Holder.
355366

356367
5. You may charge a reasonable copying fee for any distribution of this
357-
Package. You may charge any fee you choose for support of this Package. You
358-
may not charge a fee for this Package itself. However, you may distribute this
359-
Package in aggregate with other (possibly commercial) programs as part of a
360-
larger (possibly commercial) software distribution provided that you do not
361-
advertise this Package as a product of your own.
362-
363-
6. The scripts and library files supplied as input to or produced as output
364-
from the programs of this Package do not automatically fall under the copyright
365-
of this Package, but belong to whomever generated them, and may be sold
366-
commercially, and may be aggregated with this Package.
367-
368-
7. C or perl subroutines supplied by you and linked into this Package shall not
369-
be considered part of this Package.
370-
371-
8. The name of the Copyright Holder may not be used to endorse or promote
368+
Package. You may charge any fee you choose for support of this
369+
Package. You may not charge a fee for this Package itself. However,
370+
you may distribute this Package in aggregate with other (possibly
371+
commercial) programs as part of a larger (possibly commercial) software
372+
distribution provided that you do not advertise this Package as a
373+
product of your own. You may embed this Package's interpreter within
374+
an executable of yours (by linking); this shall be construed as a mere
375+
form of aggregation, provided that the complete Standard Version of the
376+
interpreter is so embedded.
377+
378+
6. The scripts and library files supplied as input to or produced as
379+
output from the programs of this Package do not automatically fall
380+
under the copyright of this Package, but belong to whoever generated
381+
them, and may be sold commercially, and may be aggregated with this
382+
Package. If such scripts or library files are aggregated with this
383+
Package via the so-called "undump" or "unexec" methods of producing a
384+
binary executable image, then distribution of such an image shall
385+
neither be construed as a distribution of this Package nor shall it
386+
fall under the restrictions of Paragraphs 3 and 4, provided that you do
387+
not represent such an executable image as a Standard Version of this
388+
Package.
389+
390+
7. C subroutines (or comparably compiled subroutines in other
391+
languages) supplied by you and linked into this Package in order to
392+
emulate subroutines and variables of the language defined by this
393+
Package shall not be considered part of this Package, but are the
394+
equivalent of input as in Paragraph 6, provided these subroutines do
395+
not change the language in any way that would cause it to fail the
396+
regression tests for the language.
397+
398+
8. Aggregation of this Package with a commercial distribution is always
399+
permitted provided that the use of this Package is embedded; that is,
400+
when no overt attempt is made to make this Package's interfaces visible
401+
to the end user of the commercial distribution. Such use shall not be
402+
construed as a distribution of this Package.
403+
404+
9. The name of the Copyright Holder may not be used to endorse or promote
372405
products derived from this software without specific prior written permission.
373406

374-
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
375-
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
376-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
407+
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
408+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
409+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
377410

378-
The End
411+
The End
379412

Makefile.PL

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,16 @@ use ExtUtils::MakeMaker;
99

1010
use Config;
1111
use File::Spec;
12-
12+
use Crypt::OpenSSL::Guess;
1313
my %args;
1414

15-
if ($^O ne 'MSWin32' and my $prefix = `brew --prefix --installed openssl\@1.1 2>@{[File::Spec->devnull]}`) {
16-
chomp $prefix;
17-
$args{INC} = "-I$prefix/include";
18-
$args{LIBS} = ["-L$prefix/lib -lcrypto -lssl"];
19-
} else {
20-
$args{INC} = '-I/usr/local/opt/openssl/include -I/usr/local/include/openssl -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include';
21-
$args{LIBS} = ['-L/usr/local/opt/openssl/lib -L/usr/local/lib -L/usr/lib -L/usr/local/ssl/lib -lcrypto -lssl'];
22-
}
15+
my ($major, $minor, $patch) = openssl_version();
16+
print "Installed OpenSSL: $major.$minor.$patch\n";
2317

24-
if ($^O eq 'MSWin32') {
25-
if (my $libs = `pkg-config --libs libcrypto 2>nul`) {
26-
# strawberry perl has pkg-config
27-
$args{LIBS} = [ $libs ];
28-
} else {
29-
$args{LIBS} = ['-llibeay32'] if $Config{cc} =~ /cl/; # msvc with ActivePerl
30-
$args{LIBS} = ['-leay32'] if $Config{gccversion}; # gcc
31-
}
32-
}
18+
$args{INC} = openssl_inc_paths();
19+
$args{LIBS} = [openssl_lib_paths() . ' -lssl -lcrypto'];
3320

34-
my $cc_option_flags = ' -DOPENSSL_API_COMPAT=0x10100000L';
21+
my $cc_option_flags = $major ge 3 ? ' -DOPENSSL_API_COMPAT=30000' : ' -DOPENSSL_API_COMPAT=10100';
3522

3623
if ($Config::Config{cc} =~ /gcc/i) {
3724
$cc_option_flags .= $ENV{AUTHOR_TESTING} ? ' -Wall -Werror' : ' -Wall';
@@ -40,7 +27,10 @@ if ($Config::Config{cc} =~ /gcc/i) {
4027
}
4128

4229
if ($Config{gccversion} =~ /llvm/i) {
43-
if ( $^O eq 'darwin' && $Config{gccversion} =~ /LLVM 12.0.5/) {
30+
if ( $^O eq 'darwin' && (
31+
$Config{gccversion} =~ /LLVM 1[2-9].\d.[5-9]/ ||
32+
$Config{gccversion} =~ /LLVM 1[3-9]/ ))
33+
{
4434
$cc_option_flags .= ' -Wno-deprecated-declarations -Wno-compound-token-split-by-macro';
4535
} else {
4636
$cc_option_flags .= ' -Wno-deprecated-declarations';
@@ -65,6 +55,7 @@ my %WriteMakefileArgs = (
6555
"ABSTRACT" => "OpenSSL Verify certificate verification in XS.",
6656
"AUTHOR" => "Timothy Legge <timlegge\@cpan.org>, Wesley Schwengle <waterkip\@cpan.org>",
6757
"CONFIGURE_REQUIRES" => {
58+
"Crypt::OpenSSL::Guess" => 0,
6859
"ExtUtils::MakeMaker" => 0
6960
},
7061
"DISTNAME" => "Crypt-OpenSSL-Verify",
@@ -78,7 +69,7 @@ my %WriteMakefileArgs = (
7869
"File::Slurper" => "0.012",
7970
"Test::Exception" => 0
8071
},
81-
"VERSION" => "0.35",
72+
"VERSION" => "0.36",
8273
"test" => {
8374
"TESTS" => "t/*.t t/author/*.t"
8475
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ The following copyright notice applies to all the files provided in
134134
this distribution, including binary files, unless explicitly noted
135135
otherwise.
136136

137-
- Copyright 2020 Timothy Legge
138-
- Copyright 2020 Wesley Schwengle
137+
- Copyright 2020-2023 Timothy Legge
138+
- Copyright 2020-2023 Wesley Schwengle
139139

140140
Based on the Original Crypt::OpenSSL::VerifyX509 by
141141

Verify.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use warnings;
55

66
require 5.010;
77

8-
our $VERSION = '0.35';
8+
our $VERSION = '0.36';
99

1010
use Crypt::OpenSSL::X509;
1111

@@ -225,9 +225,9 @@ otherwise.
225225
226226
=over
227227
228-
=item Copyright 2020 Timothy Legge
228+
=item Copyright 2020-2023 Timothy Legge
229229
230-
=item Copyright 2020 Wesley Schwengle
230+
=item Copyright 2020-2023 Wesley Schwengle
231231
232232
=back
233233

Verify.xs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,17 @@ MODULE = Crypt::OpenSSL::Verify PACKAGE = Crypt::OpenSSL::Verify
198198

199199
PROTOTYPES: DISABLE
200200

201-
#if OPENSSL_API_COMPAT >= 0x10100000L
201+
#if OPENSSL_API_COMPAT >= 10100
202202
#undef ERR_load_crypto_strings
203203
#define ERR_load_crypto_strings() /* nothing */
204204
#undef OpenSSL_add_all_algorithms
205205
#define OpenSSL_add_all_algorithms() /* nothing */
206206
#endif
207207
BOOT:
208208
ERR_load_crypto_strings();
209+
#if OPENSSL_API_COMPAT < 10100
209210
ERR_load_ERR_strings();
211+
#endif
210212
OpenSSL_add_all_algorithms();
211213

212214
=head2 register_verify_cb()
@@ -509,7 +511,7 @@ int verify(self, x509)
509511

510512
RETVAL
511513

512-
#if OPENSSL_API_COMPAT >= 0x10100000L
514+
#if OPENSSL_API_COMPAT >= 10100
513515
void __X509_cleanup(void)
514516

515517
PPCODE:

cpanfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# This file is generated by Dist::Zilla::Plugin::CPANFile v6.030
12
# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.
23

34
requires "Crypt::OpenSSL::X509" => "0";
@@ -9,6 +10,7 @@ on 'test' => sub {
910
};
1011

1112
on 'configure' => sub {
13+
requires "Crypt::OpenSSL::Guess" => "0";
1214
requires "ExtUtils::MakeMaker" => "0";
1315
};
1416

dist.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author = Wesley Schwengle <waterkip@cpan.org>
44
main_module = Verify.pm
55
license = Perl_5
66
copyright_holder = Timothy Legge and Wesley Schwengle
7-
copyright_year = 2020-2022
7+
copyright_year = 2020-2023
88

99
[Meta::Maintainers]
1010
maintainer = Timothy Legge <timlegge@cpan.org>
@@ -15,6 +15,9 @@ maintainer = Timothy Legge <timlegge@cpan.org>
1515
-remove = MakeMaker
1616
-remove = Readme
1717

18+
[Prereqs / ConfigureRequires]
19+
Crypt::OpenSSL::Guess = 0
20+
1821
[Prereqs / RuntimeRequires]
1922
perl = 5.008
2023
Crypt::OpenSSL::X509 = 0

0 commit comments

Comments
 (0)