Square pulse function?



I'm new to Maxima so forgive my ignorance, but is it possible to define 
a function on the reals, say g(t), that is equal to 1 for -1/2 <= t <= 
1/2 and 0 otherwise, that integrate knows how to handle (for definite 
integrals)?

Trying the obvious with if-then-else doesn't seem to work.

Thanks,
Paul