17 Commits

Author SHA1 Message Date
5b0a2b33c1 Bug fix - house, aspect and antiscia lists were not freed correctly
After calling g_list_free_full(), the list must be set to NULL.
2013-09-18 21:55:49 +02:00
984ed5d527 Setting the time zone value now doesn't validate the Gregorian date 2013-09-18 21:54:52 +02:00
a790512f13 Fixed GsweTimestamp to comply with documentation
Although documentation states that an "empty" timestamp object has
the current date and time in the current time zone, it was not true.
2013-09-18 21:54:17 +02:00
a7dc5cb8c0 Fixed data/Makefile.am 2013-09-18 11:59:00 +02:00
8d3e16465d Incremented patch version 2013-09-18 11:55:40 +02:00
b7f7f0c02a Bug fix: gswe_moment_get_all_planets() didn't calculate planet positions before returning the list 2013-09-18 11:55:26 +02:00
7b28bb519c RPM spec file is now generated
Version number no longer needs to be updated
2013-09-18 11:54:05 +02:00
f814f26ef4 Fixed RPM version in .spec file 2013-09-17 09:53:19 +02:00
46a59fedf6 Fixed zodiac calculation in GsweMoment
Yielded GSWE_SIGN_NONE instead of GSWE_SIGN_ARIES at position 0.0
2013-09-17 09:43:10 +02:00
115f28a6ef Fixed version numbers in pkgconfig file 2013-09-16 22:56:54 +02:00
4fd39664cc Finished RPM spec file 2013-09-16 22:37:37 +02:00
04493abe7f Removed old RPM spec file 2013-09-16 22:13:26 +02:00
30a80efb13 Merge branch 'rpm' of github.com:gergelypolonkai/swe-glib into rpm 2013-09-16 22:12:28 +02:00
05ecbae941 Changed RPM spec file to version 1.0.1
This is to comply with semver.org specifications
2013-09-16 22:11:29 +02:00
610ecb34e9 Added RPM .spec file 2013-09-16 22:08:26 +02:00
4be745f748 Added micro (patch) version to comply with semver.org 2013-09-16 22:07:34 +02:00
59eb8fd306 Added RPM .spec file 2013-09-10 13:30:15 +02:00
8 changed files with 132 additions and 17 deletions

1
.gitignore vendored
View File

@@ -80,6 +80,7 @@ src/gswe-enumtypes.c
src/gswe-enumtypes.h
src/gswetest
/data/swe-glib.pc
/data/swe-glib.spec
# Documentation related files
/docs/reference/*/*.args

View File

@@ -1,8 +1,12 @@
m4_define([swe_glib_api_version], [1.0])
m4_define([swe_glib_major_version], [1])
m4_define([swe_glib_minor_version], [0])
m4_define([swe_glib_micro_version], [3])
m4_define([swe_glib_version], [swe_glib_major_version.swe_glib_minor_version.swe_glib_micro_version])
m4_define([swe_glib_api_version], [swe_glib_major_version.0])
AC_INIT([swe-glib], [swe_glib_api_version], [gergely@polonkai.eu])
AC_CONFIG_HEADERS([config.h])
AC_INIT([SWE-GLib], [swe_glib_version], [gergely@polonkai.eu], [swe-glib])
AM_INIT_AUTOMAKE([-Wall foreign])
AC_CONFIG_HEADERS([config.h])
AM_SILENT_RULES([yes])
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [compile with debugging support])], , enable_debug=no)
@@ -10,6 +14,10 @@ if test "x$enable_debug" = "xyes" ; then
AC_DEFINE([DEBUG], [1], [Define if debugging is enabled])
fi
AC_SUBST([SWE_GLIB_MAJOR_VERSION], [swe_glib_major_version])
AC_SUBST([SWE_GLIB_MINOR_VERSION], [swe_glib_minor_version])
AC_SUBST([SWE_GLIB_MICRO_VERSION], [swe_glib_micro_version])
AC_SUBST([SWE_GLIB_VERSION], [swe_glib_version])
AC_SUBST([SWE_GLIB_API_VERSION], [swe_glib_api_version])
AC_SUBST([SWE_GLIB_API_VERSION_U], [AS_TR_SH([swe_glib_api_version])])
@@ -50,5 +58,6 @@ AC_CONFIG_FILES([
docs/reference/swe-glib/version.xml
docs/reference/swe-glib/Makefile
data/swe-glib.pc
data/swe-glib.spec
])
AC_OUTPUT

View File

@@ -59,5 +59,7 @@ sweph_DATA = \
sweph-data/seplm54.se1 \
$(NULL)
EXTRA_DIST = $(sweph_DATA)
EXTRA_DIST = \
$(sweph_DATA) \
swe-glib.spec

View File

@@ -5,7 +5,7 @@ includedir=@includedir@
Name: SWE-GLib
Description: GLib wrapper functions for the Swiss Ephemeris library
Version: @SWE_GLIB_API_VERSION@
Version: @VERSION@
Requires: glib-2.0
Libs: -L${libdir} -lswe-glib-@VERSION@
Libs: -L${libdir} -lswe-glib-@SWE_GLIB_API_VERSION@
Cflags: -I${includedir}/swe-glib

91
data/swe-glib.spec.in Normal file
View File

@@ -0,0 +1,91 @@
Name: swe-glib
Version: @SWE_GLIB_VERSION@
Release: 1%{?dist}
Summary: A GLib style wrapper library around the Swiss Ephemeris library, created by Astrodienst.
Group: Development/Libraries
License: LGPLv3+
URL: http://gergely.polonkai.eu/swe-glib/
Source: https://github.com/gergelypolonkai/%{name}/archive/v%{version}.tar.gz
BuildRequires: pkgconfig
BuildRequires: glib2-devel
BuildRequires: gettext
BuildRequires: automake autoconf libtool
BuildRequires: gtk-doc
Requires: glib2
Requires: %{name}-data = %{version}-%{release}
%description
SWE-GLib is a GLib style wrapper library around the Swiss Ephemeris library,
created by Astrodienst. It can be used for precise astronomical calculation
based on time and topographic location.
%package data
Summary: A GLib style wrapper library around the Swiss Ephemeris library, created by Astrodienst.
Group: Development/Libraries
BuildArch: noarch
%description data
The swe-glib-data package includes data files for the SWE-GLib library.
%package devel
Summary: A GLib style wrapper library around the Swiss Ephemeris library, created by Astrodienst.
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The swe-glib-devel package includes the header files for the SWE-GLib library.
%package doc
Summary: A GLib style wrapper library around the Swiss Ephemeris library, created by Astrodienst.
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
The swe-glib-doc package includes documentation for the SWE-GLib library.
%prep
%setup -q
%build
%configure --enable-gtk-doc
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_datadir}/locale/hu/LC_MESSAGES/swe-glib.mo
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%doc ChangeLog
%{_libdir}/libswe-1.75.so.*
%{_libdir}/libswe-glib-1.0.so.*
%{_libdir}/girepository-1.0/SweGlib-1.0.typelib
%files data
%{_datadir}/swe-glib/*.se1
%files doc
%doc %{_datadir}/gtk-doc/html/*
%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/*
%{_datadir}/gir-1.0/SweGlib-1.0.gir
%{_libdir}/libswe-1.75.so
%{_libdir}/libswe-glib-1.0.so
%changelog

View File

@@ -28,7 +28,7 @@ BUILT_SOURCES = gswe-enumtypes.c gswe-enumtypes.h
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = gswe-enumtypes.h.template gswe-enumtypes.c.template swe-glib-private.h
EXTRA_DIST = gswe-enumtypes.h.template gswe-enumtypes.c.template swe-glib-private.h $(INST_H_SRC_FILES)
gswe-enumtypes.h: $(gswe_headers) gswe-enumtypes.h.template
$(GLIB_MKENUMS) --template $(filter %.template,$^) $(filter-out %.template,$^) > \

View File

@@ -476,6 +476,12 @@ gswe_calculate_data_by_position(GsweMoment *moment, GswePlanet planet, gdouble p
sign = (GsweZodiac)ceil(position / 30.0);
// If position happens to be exactly 0, this calculation yields
// GSWE_SIGN_NONE, but should be GSWE_SIGN_ARIES
if (sign == 0) {
sign = 1;
}
if ((sign_info = g_hash_table_lookup(gswe_sign_info_table, GINT_TO_POINTER(sign))) == NULL) {
g_error("Calculations brought an unknown sign!");
}
@@ -529,6 +535,8 @@ gswe_moment_calculate_house_positions(GsweMoment *moment, GError **err)
if ((house_data->sign = g_hash_table_lookup(gswe_sign_info_table, GINT_TO_POINTER((gint)ceilf(cusps[i] / 30.0)))) == NULL) {
g_list_free_full(moment->priv->house_list, g_free);
moment->priv->house_list = NULL;
moment->priv->house_revision = 0;
g_set_error(err, GSWE_MOMENT_ERROR, GSWE_MOMENT_ERROR_UNKNOWN_SIGN, "Calculation brought an unknown sign");
return;
@@ -715,6 +723,8 @@ gswe_moment_calculate_all_planets(GsweMoment *moment)
GList *
gswe_moment_get_all_planets(GsweMoment *moment)
{
gswe_moment_calculate_all_planets(moment);
return moment->priv->planet_list;
}
@@ -1053,6 +1063,7 @@ gswe_moment_calculate_aspects(GsweMoment *moment)
gswe_moment_calculate_all_planets(moment);
g_list_free_full(moment->priv->aspect_list, g_free);
moment->priv->aspect_list = NULL;
for (oplanet = moment->priv->planet_list; oplanet; oplanet = oplanet->next) {
for (iplanet = moment->priv->planet_list; iplanet; iplanet = iplanet->next) {
@@ -1207,6 +1218,7 @@ gswe_moment_calculate_antiscia(GsweMoment *moment)
gswe_moment_calculate_all_planets(moment);
g_list_free_full(moment->priv->antiscia_list, g_free);
moment->priv->antiscia_list = NULL;
for (oplanet = moment->priv->planet_list; oplanet; oplanet = oplanet->next) {
for (iplanet = moment->priv->planet_list; iplanet; iplanet = iplanet->next) {

View File

@@ -94,6 +94,7 @@ gswe_timestamp_class_init(GsweTimestampClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
GDateTime *local_time = g_date_time_new_now_local();
GTimeZone *local_timezone = g_time_zone_new_local();
g_type_class_add_private(klass, sizeof(GsweTimestampPrivate));
@@ -118,7 +119,7 @@ gswe_timestamp_class_init(GsweTimestampClass *klass)
* Otherwise, the values are recalculated only upon request (e.g. on
* calling gswe_timestamp_get_julian_day()).
*/
g_object_class_install_property(gobject_class, PROP_INSTANT_RECALC, g_param_spec_boolean("instant-recalc", "Instant recalculation", "Instantly recalculate values upon parameter change", FALSE, G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_INSTANT_RECALC, g_param_spec_boolean("instant-recalc", "Instant recalculation", "Instantly recalculate values upon parameter change", FALSE, G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-valid:
@@ -135,56 +136,56 @@ gswe_timestamp_class_init(GsweTimestampClass *klass)
*
* The Gregorian year of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_YEAR, g_param_spec_int("gregorian-year", "Gregorian year", "The year according to the Gregorian calendar", G_MININT, G_MAXINT, g_date_time_get_year(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_YEAR, g_param_spec_int("gregorian-year", "Gregorian year", "The year according to the Gregorian calendar", G_MININT, G_MAXINT, g_date_time_get_year(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-month:
*
* The Gregorian month of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MONTH, g_param_spec_int("gregorian-month", "Gregorian month", "The month according to the Gregorian calendar", 1, 12, g_date_time_get_month(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MONTH, g_param_spec_int("gregorian-month", "Gregorian month", "The month according to the Gregorian calendar", 1, 12, g_date_time_get_month(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-day:
*
* The Gregorian day of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_DAY, g_param_spec_int("gregorian-day", "Gregorian day", "The day according to the Gregorian calendar", 1, 31, g_date_time_get_day_of_month(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_DAY, g_param_spec_int("gregorian-day", "Gregorian day", "The day according to the Gregorian calendar", 1, 31, g_date_time_get_day_of_month(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-hour:
*
* The Gregorian hour of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_HOUR, g_param_spec_int("gregorian-hour", "Gregorian hour", "The hour according to the Gregorian calendar", 0, 23, g_date_time_get_hour(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_HOUR, g_param_spec_int("gregorian-hour", "Gregorian hour", "The hour according to the Gregorian calendar", 0, 23, g_date_time_get_hour(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-minute:
*
* The Gregorian minute of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MINUTE, g_param_spec_int("gregorian-minute", "Gregorian minute", "The minute according to the Gregorian calendar", 0, 59, g_date_time_get_minute(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MINUTE, g_param_spec_int("gregorian-minute", "Gregorian minute", "The minute according to the Gregorian calendar", 0, 59, g_date_time_get_minute(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-second:
*
* The Gregorian second of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_SECOND, g_param_spec_int("gregorian-second", "Gregorian second", "The second according to the Gregorian calendar", 0, 61, g_date_time_get_second(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_SECOND, g_param_spec_int("gregorian-second", "Gregorian second", "The second according to the Gregorian calendar", 0, 61, g_date_time_get_second(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-microsecond:
*
* The Gregorian microsecond of the timestamp
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MICROSECOND, g_param_spec_int("gregorian-microsecond", "Gregorian microsecond", "The microsecond according to the Gregorian calendar", 0, G_MAXINT, g_date_time_get_microsecond(local_time), G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_MICROSECOND, g_param_spec_int("gregorian-microsecond", "Gregorian microsecond", "The microsecond according to the Gregorian calendar", 0, G_MAXINT, g_date_time_get_microsecond(local_time), G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:gregorian-timezone-offset:
*
* The time zone offset in hours, relative to UTC
*/
g_object_class_install_property(gobject_class, PROP_GREGORIAN_TIMEZONE_OFFSET, g_param_spec_double("gregorian-timezone-offset", "Gregorian timezone offset", "The offset relative to UTC in the Gregorian calendar", -24.0, 24.0, 0.0, G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_GREGORIAN_TIMEZONE_OFFSET, g_param_spec_double("gregorian-timezone-offset", "Gregorian timezone offset", "The offset relative to UTC in the Gregorian calendar", -24.0, 24.0, g_time_zone_get_offset(local_timezone, 1) / 3600.0, G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* GsweTimestamp:julian-day-valid:
@@ -764,7 +765,6 @@ void
gswe_timestamp_set_gregorian_timezone(GsweTimestamp *timestamp, gdouble gregorian_timezone_offset, GError **err)
{
timestamp->priv->gregorian_timezone_offset = gregorian_timezone_offset;
timestamp->priv->valid_dates = VALID_GREGORIAN;
if (timestamp->priv->instant_recalc == TRUE) {
gswe_timestamp_calculate_all(timestamp, err);