## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
# Generated by go2rpm 1.9.0
# Tests are skipped because they rely on dktest, a container testing harness
# that expects to have access to the Internet as well as a running docker daemon
# on the test host.
%bcond_with check
# This list of drivers are included when compiling the 'migrate' program.
%global _gobuildtags cassandra cockroachdb mongodb mysql postgres redshift \\\
sqlite3 github gitlab go_bindata godoc_vfs \\\
google_cloud_storage iofs pkger aws_s3 filesystem
# This list of drivers are removed before the package is built. This ensures
# that both the migrate binary and the -devel subpackage are both built with the
# desired set of drivers. These drivers are missing depdendencies; packaging
# their dependencies is required before removing a driver from this list.
%global _remove_drivers database/clickhouse \\\
database/firebird \\\
database/neo4j \\\
database/pgx \\\
database/ql \\\
database/snowflake \\\
database/spanner \\\
database/sqlcipher \\\
database/sqlite \\\
database/sqlserver \\\
database/yugabytedb \\\
source/bitbucket
# https://github.com/golang-migrate/migrate
%global goipath github.com/golang-migrate/migrate/v4
Version: 4.16.2
%gometa -f
%global goname migrate
%global common_description %{expand:
Go database migrations library and program.
This package is built with the following databases backends:
* cassandra
* cockroachdb
* mongodb
* mysql
* postgres
* redshift
* sqlite3
This package is built with the following source backends:
* github
* gitlab
* go-bindata
* godoc-vfs
* gcs
* iofs
* pkger
* s3}
%global golicenses LICENSE
%global godocs CONTRIBUTING.md FAQ.md GETTING_STARTED.md \\\
MIGRATIONS.md README.md SECURITY.md migrate-README.md \\\
cassandra-README.md \\\
cockroachdb-README.md \\\
mongodb-README.md \\\
mysql-README.md \\\
redshift-README.md \\\
postgres-README.md \\\
sqlite3-README.md \\\
file-README.md \\\
github-README.md \\\
gitlab-README.md \\\
go-bindata-README.md \\\
gcs-README.md \\\
iofs-README.md \\\
pkger-README.md \\\
s3-README.md
Name: %{goname}
Release: %autorelease
Summary: Go database migrations library and program
License: MIT
URL: %{gourl}
Source: %{gosource}
# Submitted upstream: https://github.com/golang-migrate/migrate/pull/958
Patch0: 0001-refactor-update-go-gitlab.patch
# Do not use %%go_generate_buildrequires; the list of drivers is maintained
# manually. See %%_remove_drivers above for details.
BuildRequires: golang(cloud.google.com/go/storage)
BuildRequires: golang(github.com/aws/aws-sdk-go/aws)
BuildRequires: golang(github.com/aws/aws-sdk-go/aws/session)
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3)
BuildRequires: golang(github.com/aws/aws-sdk-go/service/s3/s3iface)
BuildRequires: golang(github.com/cenkalti/backoff/v4)
BuildRequires: golang(github.com/cockroachdb/cockroach-go/v2/crdb)
BuildRequires: golang(github.com/go-sql-driver/mysql)
BuildRequires: golang(github.com/gocql/gocql)
BuildRequires: golang(github.com/google/go-github/github)
BuildRequires: golang(github.com/hashicorp/go-multierror)
BuildRequires: golang(github.com/lib/pq)
BuildRequires: golang(github.com/markbates/pkger)
BuildRequires: golang(github.com/markbates/pkger/pkging)
BuildRequires: golang(github.com/mattn/go-sqlite3)
BuildRequires: golang(github.com/xanzy/go-gitlab)
BuildRequires: golang(go.mongodb.org/mongo-driver/bson)
BuildRequires: golang(go.mongodb.org/mongo-driver/mongo)
BuildRequires: golang(go.mongodb.org/mongo-driver/mongo/options)
BuildRequires: golang(go.mongodb.org/mongo-driver/x/mongo/driver/connstring)
BuildRequires: golang(go.uber.org/atomic)
BuildRequires: golang(golang.org/x/tools/godoc/vfs)
BuildRequires: golang(golang.org/x/tools/godoc/vfs/httpfs)
BuildRequires: golang(google.golang.org/api/iterator)
%description %{common_description}
%gopkg
%prep
%goprep
%autopatch -p1
sed -i \
-e 's|"github.com/google/go-github/v39/github|"github.com/google/go-github/github|' \
$(find . -name '*.go')
rm -rf %_remove_drivers
# remove zero length README files
rm database/crate/README.md
rm database/shell/README.md
# remove test files that require dktest
rm $(grep -lr '"github.com/dhui/dktest"')
%build
export BUILDTAGS="%{_gobuildtags}"
export LDFLAGS="-X main.Version=%{version}"
%gobuild -o %{gobuilddir}/bin/migrate %{goipath}/cmd/migrate
%install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
mv cmd/migrate/README.md migrate-README.md
mv database/cassandra/README.md cassandra-README.md
mv database/cockroachdb/README.md cockroachdb-README.md
mv database/mongodb/README.md mongodb-README.md
mv database/mysql/README.md mysql-README.md
mv database/postgres/README.md postgres-README.md
mv database/redshift/README.md redshift-README.md
mv database/sqlite3/README.md sqlite3-README.md
mv source/aws_s3/README.md s3-README.md
mv source/file/README.md file-README.md
mv source/github/README.md github-README.md
mv source/gitlab/README.md gitlab-README.md
mv source/go_bindata/README.md go-bindata-README.md
mv source/google_cloud_storage/README.md gcs-README.md
mv source/iofs/README.md iofs-README.md
mv source/pkger/README.md pkger-README.md
%if %{with check}
%check
%gocheck
%endif
%files
%license LICENSE
%doc CONTRIBUTING.md FAQ.md GETTING_STARTED.md MIGRATIONS.md README.md
%doc SECURITY.md migrate-README.md
%doc cassandra-README.md
%doc cockroachdb-README.md
%doc mongodb-README.md
%doc mysql-README.md
%doc postgres-README.md
%doc redshift-README.md
%doc sqlite3-README.md
%doc file-README.md
%doc github-README.md
%doc gitlab-README.md
%doc go-bindata-README.md
%doc gcs-README.md
%doc iofs-README.md
%doc pkger-README.md
%doc s3-README.md
%{_bindir}/*
%gopkgfiles
%changelog
* Wed Jul 26 2023 Link Dupont - 4.16.2-2
- Drop snowflake driver
* Mon Jul 24 2023 Link Dupont - 4.16.2-1
- Initial package