Skip to content

Commit

Permalink
Merge pull request #968 from mackerelio/fix-packaging
Browse files Browse the repository at this point in the history
fix packaging
  • Loading branch information
yseto committed Dec 15, 2022
2 parents 5010fd2 + b65802c commit 2cd6673
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Expand Up @@ -22,6 +22,12 @@ build:
$(MAKE) $(BINDIR)/$$i; \
done

.PHONY: build-for-packaging
build-for-packaging:
for i in `cat packaging/plugin-lists`; do \
$(MAKE) $(BINDIR)/$$i; \
done

build/mackerel-plugin: $(patsubst %,depends_on,$(GOOS)$(GOARCH))
mkdir -p build
go build -ldflags="-s -w -X main.gitcommit=$(CURRENT_REVISION)" \
Expand Down Expand Up @@ -54,11 +60,11 @@ rpm: rpm-v1 rpm-v2

.PHONY: rpm-v1
rpm-v1:
$(MAKE) build GOOS=linux GOARCH=386
$(MAKE) build-for-packaging GOOS=linux GOARCH=386
rpmbuild --define "_sourcedir `pwd`" --define "_bindir build/linux/386" \
--define "_version ${VERSION}" --define "buildarch noarch" \
--target noarch -bb packaging/rpm/mackerel-agent-plugins.spec
$(MAKE) build GOOS=linux GOARCH=amd64
$(MAKE) build-for-packaging GOOS=linux GOARCH=amd64
rpmbuild --define "_sourcedir `pwd`" --define "_bindir build/linux/amd64" \
--define "_version ${VERSION}" --define "buildarch x86_64" \
--target x86_64 -bb packaging/rpm/mackerel-agent-plugins.spec
Expand Down Expand Up @@ -91,7 +97,7 @@ deb: deb-v1 deb-v2

.PHONY: deb-v1
deb-v1:
$(MAKE) build GOOS=linux GOARCH=386
$(MAKE) build-for-packaging GOOS=linux GOARCH=386
for i in `cat packaging/deb/debian/source/include-binaries`; do \
cp build/linux/386/`basename $$i` packaging/deb/debian/; \
done
Expand Down
52 changes: 52 additions & 0 deletions packaging/plugin-lists
@@ -0,0 +1,52 @@
mackerel-plugin-accesslog
mackerel-plugin-apache2
mackerel-plugin-aws-cloudfront
mackerel-plugin-aws-dynamodb
mackerel-plugin-aws-ec2-cpucredit
mackerel-plugin-aws-ec2-ebs
mackerel-plugin-aws-elasticache
mackerel-plugin-aws-elasticsearch
mackerel-plugin-aws-elb
mackerel-plugin-aws-kinesis-streams
mackerel-plugin-aws-lambda
mackerel-plugin-aws-rds
mackerel-plugin-aws-s3-requests
mackerel-plugin-aws-ses
mackerel-plugin-conntrack
mackerel-plugin-docker
mackerel-plugin-elasticsearch
mackerel-plugin-fluentd
mackerel-plugin-gostats
mackerel-plugin-h2o
mackerel-plugin-haproxy
mackerel-plugin-inode
mackerel-plugin-jmx-jolokia
mackerel-plugin-jvm
mackerel-plugin-linux
mackerel-plugin-mailq
mackerel-plugin-memcached
mackerel-plugin-mongodb
mackerel-plugin-multicore
mackerel-plugin-munin
mackerel-plugin-mysql
mackerel-plugin-nginx
mackerel-plugin-openldap
mackerel-plugin-php-apc
mackerel-plugin-php-fpm
mackerel-plugin-php-opcache
mackerel-plugin-plack
mackerel-plugin-postgres
mackerel-plugin-proc-fd
mackerel-plugin-rabbitmq
mackerel-plugin-redis
mackerel-plugin-sidekiq
mackerel-plugin-snmp
mackerel-plugin-solr
mackerel-plugin-squid
mackerel-plugin-td-table-count
mackerel-plugin-trafficserver
mackerel-plugin-twemproxy
mackerel-plugin-unicorn
mackerel-plugin-uptime
mackerel-plugin-uwsgi-vassal
mackerel-plugin-varnish
6 changes: 6 additions & 0 deletions tool/update-docs.pl
Expand Up @@ -59,6 +59,11 @@ sub update_packaging_specs {
path('packaging/deb/debian/source/include-binaries')->spew(join("\n", map { "debian/$PLUGIN_PREFIX$_" } @plugins) . "\n");
}

sub update_packaging_binaries_list {
my @plugins = @_;
path('packaging/plugin-lists')->spew(join("\n", map { "$PLUGIN_PREFIX$_" } @plugins) . "\n");
}

sub load_packaging_confg {
decode_json path('packaging/config.json')->slurp;
}
Expand All @@ -68,6 +73,7 @@ sub main {
update_readme(@plugins);
my $config = load_packaging_confg;
update_packaging_specs(sort @{ $config->{plugins} });
update_packaging_binaries_list(sort @{ $config->{plugins} });
}

main();

0 comments on commit 2cd6673

Please sign in to comment.