diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5125f60 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +EXTENSION = suncalc_postgres + +DATA = suncalc_postgres--0.0.1.sql +#TESTS = $(wildcard test/sql/*.sql) + +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) diff --git a/suncalc/suncalc.sql b/suncalc_postgres--0.0.1.sql similarity index 99% rename from suncalc/suncalc.sql rename to suncalc_postgres--0.0.1.sql index 338d435..3f123d6 100644 --- a/suncalc/suncalc.sql +++ b/suncalc_postgres--0.0.1.sql @@ -1,3 +1,5 @@ +\echo Use "CREATE EXTENSION suncalc_postgres" to load this file. \quit + CREATE OR REPLACE FUNCTION sc_fmod( dividend double precision, divisor double precision @@ -336,4 +338,4 @@ BEGIN RETURN NEXT; END LOOP; END ; -$$ LANGUAGE plpgsql IMMUTABLE; \ No newline at end of file +$$ LANGUAGE plpgsql IMMUTABLE; diff --git a/suncalc_postgres.control b/suncalc_postgres.control new file mode 100644 index 0000000..7de65f3 --- /dev/null +++ b/suncalc_postgres.control @@ -0,0 +1,5 @@ +comment = 'Solar event calculations for Postgres' +default_version = '0.0.1' +module_pathname = '$libdir/suncalc_postgres' +relocatable = true +requires = ''